<template>
  <div>

    <div class="addResumeWrapper">
        <!-- 照片与简历 -->
        <el-row :gutter="20" class="posRelative paddB100">
            <el-col :span="8">
                    <h3>照片</h3>
                    <el-upload
                        class="avatar-uploader"
                        :show-file-list="false"
                        :before-upload="beforeupload">
                        <img v-if="imageUrl" :src="imageUrl" class="avatar">
                        <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                    <div class="btnGroup">
                        <div class="el-upload__tip">只能上传jpg、jpeg、png图片，且不超过500kb</div>
                        <button class="operatBtn marT20" @click.stop="submitPhoto" :disabled="paramFile === null ? true : false" :class="{notAllowed:paramFile === null }">确认上传</button>
                    </div>
            </el-col>
            <el-col :span="8">
                    <h3>简历</h3>
                    <el-upload
                        class="upload-demo"
                        :before-upload="beforeUploadFile"
                        limit = 1>
                        <button class="operatBtn marT20" slot="trigger" :disabled="resumeFile !== null ? true : false" :class="{notAllowed:resumeFile !== null }">选择文件</button>
                        <div slot="tip" class="el-upload__tip" v-show="tmpFileName !== ''">
                            <icon name="file" class="scaleIcon1" title="文件"></icon>
                            {{tmpFileName}}
                        </div>
                    </el-upload>
                    <div class="btnGroup">
                        <div class="el-upload__tip">只能上传doc、docx、pdf文件，且不超过1M</div>
                        <!-- <button class="operatBtn marT20 marR5" @click.stop="downloadFile" :disabled="fileUrl === '' ? true : false" :class="{notAllowed:fileUrl === '' }">下载</button> -->
                        <button class="operatBtn marT20" @click.stop="submitFile" :disabled="resumeFile === null ? true : false" :class="{notAllowed:resumeFile === null }">确认上传</button>
                    </div>
            </el-col>
        </el-row>

        <div class="grayLine"></div>

        <!-- 在职信息 -->
        <el-row class="posRelative marT20 paddB60">
            <h3>在职信息</h3>
            <el-col :span="24">
                <el-form ref="incumInfo" :model="incumInfo" :rules="incumInfoRules"  class="marT10" :inline="true" hide-required-asterisk=true label-width="80px">
                    <el-row>
                        <el-col :span="8">
                            <el-form-item label="工号" prop="staffNum">
                                    <p class="ellipsis" :title="incumInfo.staffNum" v-show="!isShowStaffNumInput">{{incumInfo.staffNum}}</p>
                                    <el-input v-model.trim="incumInfo.staffNum" v-show="isShowStaffNumInput" placeholder="请输入工号" maxlength='6' class="inputTxtWrapper"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="部门" prop="depart">
                                    <p class="ellipsis" :title="incumInfo.depart">{{incumInfo.depart}}</p>
                                </el-form-item>
                        </el-col>
                        <el-col :span="8">
                            <el-form-item label="职位" prop="posName">
                                    <p class="ellipsis" :title="incumInfo.posName">{{incumInfo.posName}}</p>
                                </el-form-item>
                        </el-col>
                    </el-row>
                </el-form>

                <div class="btnGroup">
                    <button class="operatBtn marT20" @click.stop="isShowStaffNumInput = true" v-show="!isShowStaffNumInput">修改</button>
                    <button class="operatBtn marT20" @click.stop="cancelChangeStaffNum" v-show="isShowStaffNumInput">取消</button>
                    <button class="operatBtn marT20" @click.stop="updateStaffNum" v-show="isShowStaffNumInput">确认修改</button>	
                </div>

            </el-col>
        </el-row>
         <div class="grayLine"></div>
        <!-- 基本信息 -->
        <el-row class="posRelative paddB60 marT20">
            <h3>基本信息</h3>
            <!-- 基本信息文本 -->
            <el-col :span="24" v-if="!isBaseFrmShow">
                    <el-form ref="baseMsgFrm" :model="baseMsgFrm" :rules="rules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="姓名" prop="userName">
                                    <p class="ellipsis" :title="baseMsgFrm.userName">{{baseMsgFrm.userName}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="性别" prop="userSex">
                                    <p title="男" v-if="baseMsgFrm.userSex === 1">男</p>
                                    <p title="女" v-else>女</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="出生年月" prop="userBirth">
                                    <p class="ellipsis" :title="baseMsgFrm.userBirth">{{baseMsgFrm.userBirth}}</p>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="政治面貌" prop="politicalOutlook">
                                    <p class="ellipsis" title="中共党员" v-if="baseMsgFrm.politicalOutlook === 1">中共党员</p>
                                    <p class="ellipsis" title="中共预备党员"  v-else-if="baseMsgFrm.politicalOutlook === 2">中共预备党员</p>
                                    <p class="ellipsis" title="共青团员"  v-else-if="baseMsgFrm.politicalOutlook === 3">共青团员</p>
                                    <p class="ellipsis" title="民革党员"  v-else-if="baseMsgFrm.politicalOutlook === 4">民革党员</p>
                                    <p class="ellipsis" title="民盟盟员"  v-else-if="baseMsgFrm.politicalOutlook === 5">民盟盟员</p>
                                    <p class="ellipsis" title="民建会员"  v-else-if="baseMsgFrm.politicalOutlook === 6">民建会员</p>
                                    <p class="ellipsis" title="民进会员"  v-else-if="baseMsgFrm.politicalOutlook === 7">民进会员</p>
                                    <p class="ellipsis" title="农工党党员"  v-else-if="baseMsgFrm.politicalOutlook === 8">农工党党员</p>
                                    <p class="ellipsis" title="致公党党员"  v-else-if="baseMsgFrm.politicalOutlook === 9">致公党党员</p>
                                    <p class="ellipsis" title="九三学社社员"  v-else-if="baseMsgFrm.politicalOutlook === 10">九三学社社员</p>
                                    <p class="ellipsis" title="台盟盟员"  v-else-if="baseMsgFrm.politicalOutlook === 11">台盟盟员</p>
                                    <p class="ellipsis" title="无党派人士"  v-else-if="baseMsgFrm.politicalOutlook === 12">无党派人士</p>
                                    <p class="ellipsis" title="群众"  v-else-if="baseMsgFrm.politicalOutlook === 13">群众</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="婚姻状况" prop="maritalStatus">
                                    <p title="未婚" v-if="baseMsgFrm.maritalStatus === 1">未婚</p>
                                    <p title="已婚" v-else-if="baseMsgFrm.maritalStatus === 2">已婚</p>
                                    <p title="其它" v-else-if="baseMsgFrm.maritalStatus === 3">其它</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="健康状况" prop="health">
                                    <p title="健康" v-if="baseMsgFrm.health === 1">健康</p>
                                    <p title="良好" v-else-if="baseMsgFrm.health === 2">残疾</p>
                                    <!-- <p title="良好" v-else-if="baseMsgFrm.health === 2">良好</p>
                                    <p title="体弱" v-else-if="baseMsgFrm.health === 3">体弱</p>
                                    <p title="重病" v-else-if="baseMsgFrm.health === 4">重病</p>
                                    <p title="残疾" v-else-if="baseMsgFrm.health === 5">残疾</p>
                                    <p title="其它" v-else-if="baseMsgFrm.health === 6">其它</p> -->
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="籍贯" prop="nativePlace">
                                    <p class="ellipsis" :title="baseMsgFrm.nativePlace">{{baseMsgFrm.nativePlace}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="邮箱" prop="userEmail">
                                    <p class="ellipsis" :title="baseMsgFrm.userEmail">{{baseMsgFrm.userEmail}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="QQ" prop="qq">
                                    <p class="ellipsis" :title="baseMsgFrm.qq">{{baseMsgFrm.qq}}</p>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="民族" prop="nation">
                                    <p title="汉族" v-if="baseMsgFrm.nation=== 1">汉族</p>
                                    <p title="蒙古族" v-else-if="baseMsgFrm.nation=== 2">蒙古族</p>
                                    <p title="回族" v-else-if="baseMsgFrm.nation=== 3">回族</p>
                                    <p title="藏族" v-else-if="baseMsgFrm.nation=== 4">藏族</p>
                                    <p title="维吾尔族" v-else-if="baseMsgFrm.nation=== 5">维吾尔族</p>
                                    <p title="苗族" v-else-if="baseMsgFrm.nation=== 6">苗族</p>
                                    <p title="彝族" v-else-if="baseMsgFrm.nation=== 7">彝族</p>
                                    <p title="壮族" v-else-if="baseMsgFrm.nation=== 8">壮族</p>
                                    <p title="布衣族" v-else-if="baseMsgFrm.nation=== 9">布衣族</p>
                                    <p title="朝鲜族" v-else-if="baseMsgFrm.nation=== 10">朝鲜族</p>
                                    <p title="满族" v-else-if="baseMsgFrm.nation=== 11">满族</p>
                                    <p title="侗族" v-else-if="baseMsgFrm.nation=== 12">侗族</p>
                                    <p title="瑶族" v-else-if="baseMsgFrm.nation=== 13">瑶族</p>
                                    <p title="白族" v-else-if="baseMsgFrm.nation=== 14">白族</p>
                                    <p title="土家族" v-else-if="baseMsgFrm.nation=== 15">土家族</p>
                                    <p title="哈尼族" v-else-if="baseMsgFrm.nation=== 16">哈尼族</p>
                                    <p title="哈萨克族" v-else-if="baseMsgFrm.nation=== 17">哈萨克族</p>
                                    <p title="傣族" v-else-if="baseMsgFrm.nation=== 18">傣族</p>
                                    <p title="黎族" v-else-if="baseMsgFrm.nation=== 19">黎族</p>
                                    <p title="傈僳族" v-else-if="baseMsgFrm.nation=== 20">傈僳族</p>
                                    <p title="佤族" v-else-if="baseMsgFrm.nation=== 21">佤族</p>
                                    <p title="畲族" v-else-if="baseMsgFrm.nation=== 22">畲族</p>
                                    <p title="高山族" v-else-if="baseMsgFrm.nation=== 23">高山族</p>
                                    <p title="拉祜族" v-else-if="baseMsgFrm.nation=== 24">拉祜族</p>
                                    <p title="水族" v-else-if="baseMsgFrm.nation=== 25">水族</p>
                                    <p title="东乡族" v-else-if="baseMsgFrm.nation=== 26">东乡族</p>
                                    <p title="纳西族" v-else-if="baseMsgFrm.nation=== 27">纳西族</p>
                                    <p title="景颇族" v-else-if="baseMsgFrm.nation=== 28">景颇族</p>
                                    <p title="柯尔克孜" v-else-if="baseMsgFrm.nation=== 29">柯尔克孜</p>
                                    <p title="土族" v-else-if="baseMsgFrm.nation=== 30">土族</p>
                                    <p title="达斡尔族" v-else-if="baseMsgFrm.nation=== 31">达斡尔族</p>
                                    <p title="仫佬族" v-else-if="baseMsgFrm.nation=== 32">仫佬族</p>
                                    <p title="羌族" v-else-if="baseMsgFrm.nation=== 33">羌族</p>
                                    <p title="布朗族" v-else-if="baseMsgFrm.nation=== 34">布朗族</p>
                                    <p title="撒拉族" v-else-if="baseMsgFrm.nation=== 35">撒拉族</p>
                                    <p title="毛难族" v-else-if="baseMsgFrm.nation=== 36">毛难族</p>
                                    <p title="仡佬族" v-else-if="baseMsgFrm.nation=== 37">仡佬族</p>
                                    <p title="锡伯族" v-else-if="baseMsgFrm.nation=== 38">锡伯族</p>
                                    <p title="阿昌族" v-else-if="baseMsgFrm.nation=== 39">阿昌族</p>
                                    <p title="普米族" v-else-if="baseMsgFrm.nation=== 40">普米族</p>
                                    <p title="塔吉克族" v-else-if="baseMsgFrm.nation=== 41">塔吉克族</p>
                                    <p title="怒族" v-else-if="baseMsgFrm.nation=== 42">怒族</p>
                                    <p title="乌孜别克" v-else-if="baseMsgFrm.nation=== 43">乌孜别克</p>
                                    <p title="俄罗斯族" v-else-if="baseMsgFrm.nation=== 44">俄罗斯族</p>
                                    <p title="鄂温克族" v-else-if="baseMsgFrm.nation=== 45">鄂温克族</p>
                                    <p title="崩龙族" v-else-if="baseMsgFrm.nation=== 46">崩龙族</p>
                                    <p title="保安族" v-else-if="baseMsgFrm.nation=== 47">保安族</p>
                                    <p title="裕固族" v-else-if="baseMsgFrm.nation=== 48">裕固族</p>
                                    <p title="京族" v-else-if="baseMsgFrm.nation=== 49">京族</p>
                                    <p title="塔塔尔族" v-else-if="baseMsgFrm.nation=== 50">塔塔尔族</p>
                                    <p title="独龙族" v-else-if="baseMsgFrm.nation=== 51">独龙族</p>
                                    <p title="鄂伦春族" v-else-if="baseMsgFrm.nation=== 52">鄂伦春族</p>
                                    <p title="赫哲族" v-else-if="baseMsgFrm.nation=== 53">赫哲族</p>
                                    <p title="门巴族" v-else-if="baseMsgFrm.nation=== 54">门巴族</p>
                                    <p title="珞巴族" v-else-if="baseMsgFrm.nation=== 55">珞巴族</p>
                                    <p title="基诺族" v-else-if="baseMsgFrm.nation=== 56">基诺族</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="职称" prop="userTitle">
                                    <p class="ellipsis" :title="baseMsgFrm.userTitle">{{baseMsgFrm.userTitle}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="联系电话" prop="userTel">
                                    <p class="ellipsis" :title="baseMsgFrm.userTel">{{baseMsgFrm.userTel}}</p>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="身份证号" prop="userCardNo">
                                    <p class="ellipsis" :title="baseMsgFrm.userCardNo">{{baseMsgFrm.userCardNo}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="户籍地址" prop="perAddress">
                                    <p class="ellipsis" :title="baseMsgFrm.perAddress">{{baseMsgFrm.perAddress}}</p>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="联系地址" prop="concatAddress">
                                    <p class="ellipsis" :title="baseMsgFrm.concatAddress">{{baseMsgFrm.concatAddress}}</p>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="工龄" prop="existWorkingAge">
                                    <p class="ellipsis" :title="baseMsgFrm.existWorkingAge">{{baseMsgFrm.existWorkingAge === '' ? '/' : baseMsgFrm.existWorkingAge}}</p>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div class="btnGroup">
                        <button class="operatBtn marT20" @click.stop="isBaseFrmShow = true">修改</button>
                    </div>
            </el-col>
            <!-- 基本信息表单 -->
            <el-col :span="24" v-if="isBaseFrmShow">
                    <el-form ref="baseMsgFrm" :model="baseMsgFrm" :rules="rules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px">
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="姓名" prop="userName">
                                    <el-input v-model.trim="baseMsgFrm.userName" placeholder="请输入姓名" maxlength='10' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="性别" prop="userSex">
                                    <el-select v-model="baseMsgFrm.userSex" placeholder="请选择" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in sex"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="出生年月" prop="userBirth">
                                    <el-input v-model.trim="baseMsgFrm.userBirth" class="inputTxtWrapper" readonly="true"></el-input>
                                    <!-- <el-date-picker
                                        class="inputTxtWrapper"
                                        v-model="baseMsgFrm.userBirth"
                                        type="month"
                                        value-format="yyyy-MM"
                                        :editable = "false"
                                        placeholder="请选择出生年月">
                                    </el-date-picker> -->
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="政治面貌" prop="politicalOutlook">
                                    <el-select v-model="baseMsgFrm.politicalOutlook" placeholder="请选择政治面貌"  class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in outlook"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="婚姻状况" prop="maritalStatus">
                                    <el-select v-model="baseMsgFrm.maritalStatus" placeholder="请选择婚姻状况" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in maritalStatus"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="健康状况" prop="health">
                                    <el-select v-model="baseMsgFrm.health" placeholder="请选择健康状况" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in health"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="籍贯" prop="nativePlace">
                                    <el-input v-model.trim="baseMsgFrm.nativePlace" placeholder="请输入籍贯" maxlength='20' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="邮箱" prop="userEmail">
                                    <el-input v-model.trim="baseMsgFrm.userEmail" placeholder="请输入邮箱" maxlength='50' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="QQ" prop="qq">
                                    <el-input v-model.trim.number="baseMsgFrm.qq" placeholder="请输入QQ" maxlength='10' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="民族" prop="nation">
                                    <el-select v-model="baseMsgFrm.nation" placeholder="请选择民族"  class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in nation"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="职称" prop="userTitle">
                                    <el-input v-model.trim="baseMsgFrm.userTitle" placeholder="请输入职称" maxlength='15' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="联系电话" prop="userTel">
                                    <el-input v-model.trim="baseMsgFrm.userTel" placeholder="多个电话以，分隔" maxlength='100' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="身份证号" prop="userCardNo">
                                    <el-input v-model.trim="baseMsgFrm.userCardNo" placeholder="请输入身份证号" maxlength='18' class="inputTxtWrapper"  @blur.stop="changeUserBirth"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="户籍地址" prop="perAddress">
                                    <el-input v-model.trim="baseMsgFrm.perAddress" placeholder="请输入户籍所在地" maxlength='50' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="联系地址" prop="concatAddress">
                                    <el-input v-model.trim="baseMsgFrm.concatAddress" placeholder="请输入联系地址" maxlength='50' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="8">
                                <el-form-item label="工龄" prop="existWorkingAge">
                                    <el-input v-model.trim.number="baseMsgFrm.existWorkingAge" placeholder="请输入工龄(按月计)" maxlength='18' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div class="btnGroup">
                        <button class="operatBtn marT20" @click.stop="isBaseFrmShow = false">取消</button>
                        <button class="operatBtn marT20" @click.stop="submitBaseMsg">确认修改</button>
                    </div>
            </el-col>
        </el-row>

         <div class="grayLine"></div>

        <!-- 紧急联系人 -->
        <el-row class="posRelative paddB60 marT20">
            <el-col :span="24">
                    <h3>紧急联系人</h3>
                    <!-- 新增紧急联系人 -->
                    <el-form ref="memberFrm" :model="memberFrm" :rules="memberRules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px" v-show="isMemberFrmShow">
                        <el-row>
                            <el-col :span="8" :lg="8" :md="12">
                                <el-form-item label="称呼" prop="memberCall">
                                    <el-input v-model.trim="memberFrm.memberCall" placeholder="请输入称呼" maxlength='4' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" :lg="8" :md="12">
                                <el-form-item label="姓名" prop="memberName">
                                    <el-input v-model.trim="memberFrm.memberName" placeholder="请输入姓名" maxlength='10' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" :lg="8" :md="12">
                                <el-form-item label="电话" prop="memberTel">
                                    <el-input v-model.trim="memberFrm.memberTel" placeholder="多个电话以，分隔" maxlength='20' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <!-- 紧急联系人列表 -->
                    <div class="marB20 font14" v-show="!isMemberFrmShow">
                         <el-row class="headerRowClass borderT1">
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1">称呼</p>
                            </el-col>
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1">姓名</p>
                            </el-col>
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1">电话</p>
                            </el-col>
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1 borderR1">操作</p>
                            </el-col>
                        </el-row>
                        <el-row class="rowClass borderT1 tdText" v-for="(item,index) of memberList" :key="item.memberId" :index="index">
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1 ellipsis">{{item.memberCall}}</p>
                            </el-col>
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1 ellipsis">{{item.memberName}}</p>
                            </el-col>
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1 ellipsis">{{item.memberTel}}</p>
                            </el-col>
                            <el-col :span="6">
                                <p class="paddTB10 tContent borderL1 borderR1">
                                    <icon name="change" class="scaleIcon1 marR15" title="修改" @click.native.stop="editShowMemberFrm(item.memberId,index)"></icon>
                                    <icon name="del" class="scaleIcon1" title="删除" @click.native.stop="deleteMember(item.memberId,index)"></icon>
                                </p>
                            </el-col>
                        </el-row>
                    </div>

                    <div class="tipNoData" v-show="memberList.length <= 0 && !isMemberFrmShow">暂无数据</div> 

                    <div class="btnGroup">
                            <button class="operatBtn marT20" @click.stop="showMemberFrm" v-show="!isMemberFrmShow">添加</button>
                            <button class="operatBtn marT20" @click.stop="cancel" v-show="isMemberFrmShow">取消</button>
                            <button class="operatBtn marT20" @click.stop="addMember" v-show="isMemberFrmShow && isAddorEdit">确认提交</button>
                            <button class="operatBtn marT20" @click.stop="editMember" v-show="isMemberFrmShow && !isAddorEdit">确认修改</button>
                    </div>
            </el-col>
        </el-row>

        <div class="grayLine"></div>

        <!-- 教育经历 -->
        <el-row class="posRelative paddB60 marT20">
            <el-col :span="24">
                    <h3>教育经历</h3>
                    <!-- 新增教育经历 -->
                    <el-form ref="eduFrm" :model="eduFrm" :rules="eduFrmRules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px" v-show="isEduFrmShow">
                        <el-row>
                            <el-col :span="8" :lg="8" :md="12">
                                <el-form-item label="学历" prop="education">
                                    <el-select v-model="eduFrm.education" placeholder="请选择" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in educationArr"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" :lg="8" :md="12">
                                <el-form-item label="毕业院校" prop="gradSchool">
                                    <el-input v-model.trim="eduFrm.gradSchool" placeholder="请输入毕业院校" maxlength='20' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" :lg="8" :md="12">
                                <el-form-item label=" 专业" prop="professName">
                                    <el-input v-model.trim="eduFrm.professName" placeholder="多个专业以，分隔" maxlength='30' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8" :lg="8" :md="12" v-if="isEduFrmShow && !isAddorEditEduBtn">
                                <el-form-item label="修改原因" prop="editReason">
                                    <el-input v-model.trim="eduFrm.editReason" placeholder="请输入修改原因" maxlength='150' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <!-- 教育经历列表 -->
                    <div class="marB20 font14" v-show="!isEduFrmShow && eduList.length > 0">
                         <el-row class="headerRowClass borderT1">
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    学历
                                    <!-- <span class="tableCaretWrapper">
                                        <i class="tableSortCaret tableAscending" @click.stop="sortAscByEducation"></i>
                                        <i class="tableSortCaret tableDescending" @click.stop="sortDescByEducation"></i>
                                    </span> -->
                                </p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1">毕业院校</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1">专业名称</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    审核状态
                                    <!-- <span class="tableCaretWrapper">
                                        <i class="tableSortCaret tableAscending" @click.stop="sortAscByAuditStatus"></i>
                                        <i class="tableSortCaret tableDescending" @click.stop="sortDescByAuditStatus"></i>
                                    </span> -->
                                </p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1">审核理由</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1">修改原因</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">操作</p>
                            </el-col>
                        </el-row>
                        <el-row class="rowClass borderT1 tdText" v-for="(item,index) of eduList" :key="item.eduId" :index="index">
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" title="初中及以下" v-if="item.education === 1">初中及以下</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="高中" v-else-if="item.education === 2">高中</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="专科" v-else-if="item.education === 3">专科</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="本科(成教)" v-else-if="item.education === 4">本科(成教)</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="本科(民办 / 自考)" v-else-if="item.education === 5">本科(民办 / 自考)</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="本科(二本)" v-else-if="item.education === 6">本科(二本)</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="本科(一本)" v-else-if="item.education === 7">本科(一本)</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="本科(211)" v-else-if="item.education === 8">本科(211)</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="本科(985)" v-else-if="item.education === 9">本科(985)</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="硕士 / 工硕" v-else-if="item.education === 10">硕士 / 工硕</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="博士" v-else-if="item.education === 11">博士</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.gradSchool">{{item.gradSchool}}</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.professName">{{item.professName}}</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" title="待审核" v-if="item.auditStatus === 1">待审核</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核通过" v-else-if="item.auditStatus === 2">审核通过</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核不通过" v-else-if="item.auditStatus === 3">审核不通过</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.auditFailReason">{{item.auditFailReason}}</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.editReason">{{item.editReason}}</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">
                                    <icon name="change" class="scaleIcon1 marR15" title="修改" @click.native.stop="editShowEduFrm(item.eduId,index)"></icon>
                                    <icon name="del" class="scaleIcon1 marR15" title="删除" @click.native.stop="deleteEdu(item.eduId,index)"></icon>
                                    <icon name="examine" class="scaleIcon1" title="审核" @click.native.stop="examineEdu(item.eduId,index)" :class="{hideIcon:item.auditStatus !== 1}"></icon>
                                </p>
                            </el-col>
                        </el-row>
                    </div>

                    <div class="tipNoData" v-show="eduList.length <= 0 && !isEduFrmShow">暂无数据</div> 

                    <div class="btnGroup">
                            <button class="operatBtn marT20" @click.stop="showEduFrm" v-show="!isEduFrmShow">添加</button>
                            <button class="operatBtn marT20" @click.stop="cancelEduFrm" v-show="isEduFrmShow">取消</button>
                            <button class="operatBtn marT20" @click.stop="addEdu" v-show="isEduFrmShow && isAddorEditEduBtn">确认提交</button>
                            <button class="operatBtn marT20" @click.stop="editEdu" v-show="isEduFrmShow && !isAddorEditEduBtn">确认修改</button>
                    </div>
            </el-col>
        </el-row>
        
        <div class="grayLine"></div>

        <!-- 奖惩记录 -->
        <el-row class="posRelative paddB60 marT20">
            <el-col :span="24">
                    <h3>奖惩记录</h3>
                    <!-- 新增奖惩记录 -->
                    <el-form ref="rewardFrm" :model="rewardFrm" :rules="rewardFrmRules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px" v-show="isRewardFrmShow">
                        <el-row>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="文件编号" prop="fileNum">
                                    <el-input v-model.trim.number="rewardFrm.fileNum" placeholder="请输入文件编号" maxlength='20' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label=" 奖惩类型" prop="rewardsType">
                                    <el-select v-model="rewardFrm.rewardsType" placeholder="请选择" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in rewardsArr"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="奖惩金额" prop="rewardsMoney">
                                    <el-input v-model.trim.number="rewardFrm.rewardsMoney" placeholder="请输入奖惩金额" maxlength='6' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="奖惩原因" prop="rewardsReason">
                                    <el-input v-model.trim="rewardFrm.rewardsReason" placeholder="请输入奖惩原因" maxlength='30' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="奖惩日期" prop="rewardsTime">
                                    <el-date-picker
                                        class="inputTxtWrapper"
                                        v-model="rewardFrm.rewardsTime"
                                        type="date"
                                        value-format="yyyy-MM-dd"
                                        :editable = "false"
                                        placeholder="请选择奖惩日期">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12" v-if="isRewardFrmShow && !isAddorEditRewardBtn">
                                <el-form-item label="修改原因" prop="editReason">
                                    <el-input v-model.trim="rewardFrm.editReason" placeholder="请输入修改原因" maxlength='150' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <!-- 奖惩记录 -->
                    <div class="marB20 font14" v-show="!isRewardFrmShow && rewardList.length > 0">
                         <el-row class="headerRowClass borderT1">
                             <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    文件编号
                                    <!-- <span class="tableCaretWrapper">
                                        <i class="tableSortCaret tableAscending" @click.stop="sortAscByRewardType"></i>
                                        <i class="tableSortCaret tableDescending" @click.stop="sortDescByRewardType"></i>
                                    </span> -->
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    奖惩类型
                                    <!-- <span class="tableCaretWrapper">
                                        <i class="tableSortCaret tableAscending" @click.stop="sortAscByRewardType"></i>
                                        <i class="tableSortCaret tableDescending" @click.stop="sortDescByRewardType"></i>
                                    </span> -->
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    奖惩日期
                                    <!-- <span class="tableCaretWrapper">
                                        <i class="tableSortCaret tableAscending" @click.stop="sortAscByRewardTime"></i>
                                        <i class="tableSortCaret tableDescending" @click.stop="sortDescByRewardTime"></i>
                                    </span> -->
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">奖惩金额</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1">奖惩原因</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    审核状态
                                    <!-- <span class="tableCaretWrapper">
                                        <i class="tableSortCaret tableAscending" @click.stop="sortAscByRewardAuditStatus"></i>
                                        <i class="tableSortCaret tableDescending" @click.stop="sortDescByRewardAuditStatus"></i>
                                    </span> -->
                                </p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1">审核理由</p>
                            </el-col>
                             <el-col :span="3">
                                <p class="paddTB10 tContent borderL1">修改原因</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">操作</p>
                            </el-col>
                        </el-row>
                        <el-row class="rowClass borderT1 tdText" v-for="(item,index) of rewardList" :key="item.rewardId" :index="index">
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.fileNum">{{item.fileNum}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" title="奖励" v-if="item.rewardsType === 1">奖励</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="口头警告" v-else-if="item.rewardsType === 2">口头警告</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="书面警告" v-else-if="item.rewardsType === 3">书面警告</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="一类事故" v-else-if="item.rewardsType === 4">一类事故</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="二类事故" v-else-if="item.rewardsType === 5">二类事故</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="三类事故" v-else-if="item.rewardsType === 6">三类事故</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="四类事故" v-else-if="item.rewardsType === 7">四类事故</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="五类事故" v-else-if="item.rewardsType === 8">五类事故</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="六类事故" v-else-if="item.rewardsType === 9">六类事故</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.rewardsTime">{{item.rewardsTime}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.rewardsMoney">{{item.rewardsMoney}}</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.rewardsReason">{{item.rewardsReason}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" title="待审核" v-if="item.auditStatus === 1">待审核</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核通过" v-else-if="item.auditStatus === 2">审核通过</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核不通过" v-else-if="item.auditStatus === 3">审核不通过</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.auditFailReason">{{item.auditFailReason}}</p>
                            </el-col>
                            <el-col :span="3">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.editReason">{{item.editReason}}</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">
                                    <icon name="change" class="scaleIcon1 marR15" title="修改" @click.native.stop="editShowRewardFrm(item.rewardId,index)"></icon>
                                    <icon name="del" class="scaleIcon1 marR15" title="删除" @click.native.stop="deleteReward(item.rewardId,index)"></icon>
                                    <icon name="examine" class="scaleIcon1" title="审核" @click.native.stop="examineReward(item.rewardId,index)" :class="{hideIcon:item.auditStatus !== 1}"></icon>
                                </p>
                            </el-col>
                        </el-row>
                    </div>

                    <div class="tipNoData" v-show="rewardList.length <= 0 && !isEduFrmShow">暂无数据</div> 

                    <div class="btnGroup">
                            <button class="operatBtn marT20" @click.stop="showRewardFrm" v-show="!isRewardFrmShow">添加</button>
                            <button class="operatBtn marT20" @click.stop="cancelRewardFrm" v-show="isRewardFrmShow">取消</button>
                            <button class="operatBtn marT20" @click.stop="addReward" v-show="isRewardFrmShow && isAddorEditRewardBtn">确认提交</button>
                            <button class="operatBtn marT20" @click.stop="editReward" v-show="isRewardFrmShow && !isAddorEditRewardBtn">确认修改</button>
                    </div>
            </el-col>
        </el-row>
        
        <div class="grayLine"></div>

        <!-- 调岗记录 -->
        <el-row class="posRelative paddB60 marT20">
            <el-col :span="24">
                    <h3>调岗记录</h3>
                    <!-- 新增调岗记录 -->
                    <el-form ref="postTransFrm" :model="postTransFrm" :rules="postTransFrmRules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px" v-show="isPostTransFrmShow">
                        <el-row>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="文件编号" prop="fileNum">
                                    <el-input v-model.trim="postTransFrm.fileNum" placeholder="请输入文件编号" maxlength='20' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="原职位" prop="oldPostId">
                                    <el-select v-model="postTransFrm.oldPostId" placeholder="请选择" class="inputTxtWrapper" disabled>
                                        <el-option
                                            v-for="item in posList"
                                            :key="item.id"
                                            :label="item.pos_name"
                                            :value="item.id"
                                            :disabled="item.is_show === 2">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="原部门" prop="oldDepartId">
                                    <el-select v-model="postTransFrm.oldDepartId" placeholder="请选择" class="inputTxtWrapper" disabled>
                                        <el-option
                                            v-for="item in departs"
                                            :key="item.id"
                                            :label="item.depart_name"
                                            :value="item.id"
                                            :disabled="item.is_show === 2">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="新职位" prop="newPostId">
                                    <el-select v-model="postTransFrm.newPostId" placeholder="请选择" class="inputTxtWrapper" @change="selNewPos">
                                        <el-option
                                            v-for="item in posList"
                                            :key="item.id"
                                            :label="item.pos_name"
                                            :value="item.id"
                                            :disabled="item.is_show === 2">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="新部门" prop="newDepartId">
                                    <el-select v-model="postTransFrm.newDepartId" placeholder="请选择" class="inputTxtWrapper" @change="selNewDepart">
                                        <el-option
                                            v-for="item in departs"
                                            :key="item.id"
                                            :label="item.depart_name"
                                            :value="item.id"
                                            :disabled="item.is_show === 2">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="调岗原因" prop="postAdjustReason">
                                    <el-input v-model.trim="postTransFrm.postAdjustReason" placeholder="请输入调岗原因" maxlength='30' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="调岗日期" prop="postAdjustTime">
                                    <el-date-picker
                                        class="inputTxtWrapper"
                                        v-model="postTransFrm.postAdjustTime"
                                        type="date"
                                        value-format="yyyy-MM-dd"
                                        :editable = "false"
                                        placeholder="请选择调岗日期">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12" v-if="isPostTransFrmShow && !isAddorEditPostTransBtn">
                                <el-form-item label="修改原因" prop="editReason">
                                    <el-input v-model.trim="postTransFrm.editReason" placeholder="请输入修改原因" maxlength='150' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <!-- 调岗记录 -->
                    <div class="marB20 font14" v-show="!isPostTransFrmShow && postTransList.length > 0">
                         <el-row class="headerRowClass borderT1">
                             <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    文件编号
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    原职位
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    新职位
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    原部门
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    新部门
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    调岗原因
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    调岗时间
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    审核状态
                                    <!-- <span class="tableCaretWrapper">
                                        <i class="tableSortCaret tableAscending" @click.stop="sortAscByRewardAuditStatus"></i>
                                        <i class="tableSortCaret tableDescending" @click.stop="sortDescByRewardAuditStatus"></i>
                                    </span> -->
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">审核理由</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">修改原因</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">操作</p>
                            </el-col>
                        </el-row>
                        <el-row class="rowClass borderT1 tdText" v-for="(item,index) of postTransList" :key="item.postTransId" :index="index">
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.fileNum">{{item.fileNum}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.oldPostName">{{item.oldPostName}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.newPostName">{{item.newPostName}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.oldDepartName">{{item.oldDepartName}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.newDepartName">{{item.newDepartName}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.postAdjustReason">{{item.postAdjustReason}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.postAdjustTime">{{item.postAdjustTime}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" title="待审核" v-if="item.auditStatus === 1">待审核</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核通过" v-else-if="item.auditStatus === 2">审核通过</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核不通过" v-else-if="item.auditStatus === 3">审核不通过</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.auditFailReason">{{item.auditFailReason}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.editReason">{{item.editReason}}</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">
                                    <icon name="change" class="scaleIcon1 marR15" title="修改" @click.native.stop="editShowPostTransFrm(item.postTransId,index)"></icon>
                                    <icon name="del" class="scaleIcon1 marR15" title="删除" @click.native.stop="deletePostTrans(item.postTransId,index)"></icon>
                                    <icon name="examine" class="scaleIcon1" title="审核" @click.native.stop="examinePostTrans(item.postTransId,index)" :class="{hideIcon:item.auditStatus !== 1}"></icon>
                                </p>
                            </el-col>
                        </el-row>
                    </div>

                    <div class="tipNoData" v-show="postTransList.length <= 0 && !isPostTransFrmShow">暂无数据</div> 

                    <div class="btnGroup">
                            <button class="operatBtn marT20" @click.stop="showPostTransFrm" v-show="!isPostTransFrmShow">添加</button>
                            <button class="operatBtn marT20" @click.stop="cancelPostTransFrm" v-show="isPostTransFrmShow">取消</button>
                            <button class="operatBtn marT20" @click.stop="addPostTrans" v-show="isPostTransFrmShow && isAddorEditPostTransBtn">确认提交</button>
                            <button class="operatBtn marT20" @click.stop="editPostTrans" v-show="isPostTransFrmShow && !isAddorEditPostTransBtn">确认修改</button>
                    </div>
            </el-col>
        </el-row>
        
        <div class="grayLine"></div>

        <!-- 人员状态记录 -->
        <el-row class="posRelative paddB60 marT20">
            <el-col :span="24">
                    <h3>人员状态记录</h3>
                    <el-form ref="userStatusFrm" :model="userStatusFrm" :rules="userStatusFrmRules" class="marT10" :inline="true" hide-required-asterisk=true label-width="80px" v-show="isUserStatusFrmShow">
                        <el-row>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="工作状态" prop="workNature">
                                    <el-select v-model="userStatusFrm.workNature" placeholder="请选择" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in workNatureArr"
                                            :key="item.type"
                                            :label="item.label"
                                            :value="item.type">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="技能等级" prop="skillLevel">
                                    <el-select v-model="userStatusFrm.skillLevel" placeholder="请选择" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in levelArr"
                                            :key="item"
                                            :label="item"
                                            :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="经验等级" prop="experienceLevel">
                                    <el-select v-model="userStatusFrm.experienceLevel" placeholder="请选择" class="inputTxtWrapper">
                                        <el-option
                                            v-for="item in levelArr"
                                            :key="item"
                                            :label="item"
                                            :value="item">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12">
                                <el-form-item label="开始时间" prop="eventTime">
                                    <el-date-picker
                                        class="inputTxtWrapper"
                                        v-model="userStatusFrm.eventTime"
                                        type="date"
                                        value-format="yyyy-MM-dd"
                                        :editable = "false"
                                        placeholder="请选择开始时间">
                                    </el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="6" :lg="8" :md="12" v-if="isUserStatusFrmShow && !isAddorEditUserStatusBtn">
                                <el-form-item label="修改原因" prop="editReason">
                                    <el-input v-model.trim="userStatusFrm.editReason" placeholder="请输入修改原因" maxlength='150' class="inputTxtWrapper"></el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>

                    <div class="marB20 font14" v-show="!isUserStatusFrmShow && userStatusList.length > 0">
                         <el-row class="headerRowClass borderT1">
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    工作状态
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    技能等级
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    经验等级
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    开始时间
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    本司工龄
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">
                                    社保期数
                                </p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 posRelative">
                                    审核状态
                                </p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1">审核理由</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1">修改原因</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">操作</p>
                            </el-col>
                        </el-row>
                        <el-row class="rowClass borderT1 tdText" v-for="(item,index) of userStatusList" :key="item.userStatusId" :index="index">
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" title="在职" v-if="item.workNature === 1">在职</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="离职" v-else-if="item.workNature === 2">离职</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="实习" v-else-if="item.workNature === 3">实习</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="试用" v-else-if="item.workNature === 4">试用</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="停薪留职" v-else-if="item.workNature === 5">停薪留职</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.skillLevel">{{item.skillLevel}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.experienceLevel">{{item.experienceLevel}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.eventTime">{{item.eventTime}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.comWorkingTime">{{item.comWorkingTime}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.totalWorkingTime">{{item.totalWorkingTime}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" title="待审核" v-if="item.auditStatus === 1">待审核</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核通过" v-else-if="item.auditStatus === 2">审核通过</p>
                                <p class="paddTB10 tContent borderL1 ellipsis" title="审核不通过" v-else-if="item.auditStatus === 3">审核不通过</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.auditFailReason">{{item.auditFailReason}}</p>
                            </el-col>
                            <el-col :span="2">
                                <p class="paddTB10 tContent borderL1 ellipsis" :title="item.editReason">{{item.editReason}}</p>
                            </el-col>
                            <el-col :span="4">
                                <p class="paddTB10 tContent borderL1 borderR1">
                                    <icon name="change" class="scaleIcon1 marR15" title="修改" @click.native.stop="editShowUserStatusFrm(item.userStatusId,index)"></icon>
                                    <icon name="del" class="scaleIcon1 marR15" title="删除" @click.native.stop="deleteUserStatus(item.userStatusId,index)"></icon>
                                    <icon name="examine" class="scaleIcon1" title="审核" @click.native.stop="examineUserStatus(item.userStatusId,index)" :class="{hideIcon:item.auditStatus !== 1}"></icon>
                                </p>
                            </el-col>
                        </el-row>
                    </div>

                    <div class="tipNoData" v-show="userStatusList.length <= 0 && !isUserStatusFrmShow">暂无数据</div> 

                    <div class="btnGroup">
                            <button class="operatBtn marT20" @click.stop="showUserStatusFrm" v-show="!isUserStatusFrmShow">添加</button>
                            <button class="operatBtn marT20" @click.stop="cancelUserStatusFrm" v-show="isUserStatusFrmShow">取消</button>
                            <button class="operatBtn marT20" @click.stop="addUserStatus" v-show="isUserStatusFrmShow && isAddorEditUserStatusBtn">确认提交</button>
                            <button class="operatBtn marT20" @click.stop="editUserStatus" v-show="isUserStatusFrmShow && !isAddorEditUserStatusBtn">确认修改</button>
                    </div>
            </el-col>
        </el-row>
    </div>

    <!-- 图片裁剪组件 -->
    <div class="cropperWrapper" v-if="isShowCropper">
        <vueCropper ref="cropper"
                    :img="option.img"
                    :outputSize="option.outputSize"

                    :outputType="option.outputType"
                    :info="option.info"
                    :canScale="option.canScale"
                    :autoCrop="option.autoCrop"
                    :autoCropWidth="option.autoCropWidth"
                    :autoCropHeight="option.autoCropHeight"
                    :fixed="option.fixed"
                    :fixedNumber="option.fixedNumber"
                   ></vueCropper>
        <div class="cropperBtnPos">
            <button class="operatBtn" @click.stop="onCubeImg">确认裁剪</button>
            <button class="operatBtn" @click.stop="cancelCubeImg">取消</button>
        </div>
    </div>

    <!-- 教育经历审核弹框 -->
    <el-dialog
    title="教育经历审核"
    :visible.sync="eduDialogVisible"
    width="30%"
    :before-close="cancelExamineEdu"
    center>
    <el-radio-group v-model="auditStatus">
        <el-radio :label="2">通过</el-radio>
        <el-radio :label="3">不通过</el-radio>
    </el-radio-group>
    <el-input v-model.trim = "auditFailReason" placeholder="请输入审核原因" maxlength='20' class="inputTxtWrapper marT20"></el-input>
    <p class="tipRed" v-show="auditStatus === 3">审核不通过需要填写原因</p>
    <span slot="footer" class="dialog-footer">
        <el-button @click="cancelExamineEdu">取 消</el-button>
        <el-button type="primary" @click="sureExamineEdu">确 定</el-button>
    </span>
    </el-dialog>

    <!-- 奖惩记录审核弹框 -->
    <el-dialog
    title="奖惩记录审核"
    :visible.sync="rewardDialogVisible"
    width="30%"
    :before-close="cancelExamineReward"
    center>
    <el-radio-group v-model="rewardAuditStatus">
        <el-radio :label="2">通过</el-radio>
        <el-radio :label="3">不通过</el-radio>
    </el-radio-group>
    <el-input v-model.trim = "rewardsReason" placeholder="请输入审核原因" maxlength='20' class="inputTxtWrapper marT20"></el-input>
    <p class="tipRed" v-show="rewardAuditStatus === 3">审核不通过需要填写原因</p>
    <span slot="footer" class="dialog-footer">
        <el-button @click="cancelExamineReward">取 消</el-button>
        <el-button type="primary" @click="sureExamineReward">确 定</el-button>
    </span>
    </el-dialog>

    <!-- 调岗记录审核弹框 -->
    <el-dialog
    title="调岗记录审核"
    :visible.sync="postTransDialogVisible"
    width="30%"
    :before-close="cancelExaminePostTrans"
    center>
    <el-radio-group v-model="postTransAuditStatus">
        <el-radio :label="2">通过</el-radio>
        <el-radio :label="3">不通过</el-radio>
    </el-radio-group>
    <el-input v-model.trim = "postAdjustReason" placeholder="请输入审核原因" maxlength='20' class="inputTxtWrapper marT20"></el-input>
    <p class="tipRed" v-show="postTransAuditStatus === 3">审核不通过需要填写原因</p>
    <span slot="footer" class="dialog-footer">
        <el-button @click="cancelExaminePostTrans">取 消</el-button>
        <el-button type="primary" @click="sureExaminePostTrans">确 定</el-button>
    </span>
    </el-dialog>

    <!-- 状态记录审核弹框 -->
    <el-dialog
    title="状态记录审核"
    :visible.sync="userStatusDialogVisible"
    width="30%"
    :before-close="cancelExamineUserStatus"
    center>
    <el-radio-group v-model="userStatusAuditStatus">
        <el-radio :label="2">通过</el-radio>
        <el-radio :label="3">不通过</el-radio>
    </el-radio-group>
    <el-input v-model.trim = "userStatusAdjustReason" placeholder="请输入审核原因" maxlength='20' class="inputTxtWrapper marT20"></el-input>
    <p class="tipRed" v-show="userStatusAuditStatus === 3">审核不通过需要填写原因</p>
    <span slot="footer" class="dialog-footer">
        <el-button @click="cancelExamineUserStatus">取 消</el-button>
        <el-button type="primary" @click="sureExamineUserStatus">确 定</el-button>
    </span>
    </el-dialog>

  </div>
</template>



<script>
  import http from '@/assets/js/http'
//   import Cookies from 'js-cookie'
  import _g from '@/assets/js/global'
  import config from '@/assets/js/config.js'

    // import { dataURItoBlob,validateChinese,validateCardNo,validateQQ,validateNonnegativeInt,validateNonnegativeNum,validateCapital,validateNum} from "@/assets/js/common.js"
    import { dataURItoBlob,validateCardNo,validateQQ,validateNonnegativeInt,validateNonnegativeNum,validateCapital,validateNum} from "@/assets/js/common.js"

   import { sex,outlook,maritalStatus,health,nation,educationArr,workNatureArr,rewardsArr,levelArr} from "@/assets/js/data.js"

  export default {
      data() {

    // 验证工号
    let validateStaffNum = (rule, value, callback) => {
        const firstChar = value.slice(0,1)
        if(!validateCapital(firstChar)){
            callback(new Error("首字符为大写字母"))
        }
        const str = value.slice(1)
        if (!validateNum(str)) {
            callback(new Error("请输入数字值"))
        }else{
            callback()
        }
    }

        // 验证名字是否为中文
        // let validateUserName =  (rule, value, callback) => {
        //     if (!validateChinese(value)) {
        //         callback(new Error("请输入中文"))
        //     }else{
        //         callback()
        //     }
        // }

        // 验证QQ
        let validateUserQQ =  (rule, value, callback) => {
            if (!validateQQ(value)) {
                callback(new Error("请输入正确的qq号"))
            }else{
                callback()
            }
        }

    // 身份证验证
    let validateCardNum =  (rule, value, callback) => {
        if (!validateCardNo(value)) {
            callback(new Error("身份证输入不合法"))
        }else{
            callback()
        }
    }

    // 工龄验证
    let validateWoringAge =  (rule, value, callback) => {
        if (value !== '' && !validateNonnegativeInt(value)) {
            callback(new Error("请输入非负整数"))
        }else{
            callback()
        }
    }

    // 奖惩金额
    let validateRewardsMoney =  (rule, value, callback) => {
        if (!validateNonnegativeNum(value)) {
            callback(new Error("请输入非负数"))
        }else{
            callback()
        }
    }

        return {
            // 前端静态数据
            sex,outlook,maritalStatus,health,nation,educationArr,workNatureArr,rewardsArr,levelArr,


            userId:null,                                                                    //  用户id

            // 裁剪组件的基础配置option
            option: {
                img: '',                         //裁剪图片的地址
                info: true,                      //裁剪框的大小信息
                outputSize: 0.8,                   // 裁剪生成图片的质量
                outputType: 'jpg',              //裁剪生成图片的格式
                canScale: false,                 // 图片是否允许滚轮缩放
                autoCrop: true,                  // 是否默认生成截图框
                autoCropWidth: 150,              // 默认生成截图框宽度
                autoCropHeight: 150,             // 默认生成截图框高度
                canMove: true,                      //  能否拖动图片
                fixed: true,                    //是否开启截图框宽高固定比例
                // fixedNumber: [4, 4],              //截图框的宽高比例
                centerBox: true                 //  截图框是否限制在图片里(只有在自动生成截图框时才能生效)
            },
            isShowCropper: false,            //是否显示截图框

            fileList: [],                           
            imageUrl: '',                                                               //..图片路径
            // fileUrl: '',                                                               //..简历文件路径
            
            oldPhotoName:'',                                                //..最新一次上传的图片名称
            oldFileName:'',                                                 //..最新一次上传的简历文件名称
            tmpFileName:'',                                                 //..临时展示的简历文件名

            paramFile:null,                                                      //  图片
            resumeFile:null,                                                    //  简历

            // 在职信息
            incumInfo:{
                oldStaffNum : '',                                                   //  旧工号
                staffNum : '',                                                      //  工号
                depart:'',                                                              //..部门
                posName:'',                                                              //..职位
                departId:'',                                                              //..部门Id
                posId:'',                                                              //..职位Id
            },
            isShowStaffNumInput : false,                                //  工号文本框默认不显示

            // 基本信息
            baseMsgFrm:{
                userName:'',//..姓名
                userSex:1, //..性别
                userBirth:'',//..出生年月
                politicalOutlook:13,       //  政治面貌
                maritalStatus:1,       //  婚姻状况
                health:1,                   //  健康状况
                nativePlace:'',         //..籍贯
                userEmail:'',       //..邮箱
                qq:'',                //  QQ       
                nation:1,           //  民族              
                userTitle:'',   //..职称
                userTel:'',     //..联系电话
                userCardNo:'',      //..身份证号
                perAddress:'',      //..户籍所在地
                concatAddress:'',      //..联系地址
                existWorkingAge:'',  //  入职前工龄
            },

            isBaseFrmShow:false,                                                            //  基本信息表单默认隐藏 

            // 新增的家庭成员信息
            memberFrm:{
                memberCall:'',  //  称呼
                memberName:'',  //  姓名
                memberTel:'',  //  电话
            },
            memberList:[],                                                      //  家庭人员列表
            isMemberFrmShow:false,                                      //  默认隐藏家庭人员表单
            isAddorEdit:true,                                                   //  默认为确认提交按钮
            currEditorMember:{
                 memberId:null,                                              //  当前修改的紧急联系人的id
                 index:null,                                              //  当前修改的紧急联系人的数组索引
            },

            // 教育经历开始
            eduFrm:{
                education:6,  //  学历
                gradSchool:'',  //  毕业院校
                professName:'',  //  专业名称
                editReason:'',  // 修改原因
            },
            eduList:[],                                                      //  教育经历列表
            isEduFrmShow:false,                                      //  默认隐藏教育经历表单
            isAddorEditEduBtn:true,                                                   //  默认为确认提交按钮
            currEditorEdu:{
                 eduId:null,                                              //  当前修改的教育经历的id
                 index:null,                                              //  当前修改的教育经历的数组索引
            },
            eduDialogVisible:false,                             //  教育经历审核弹框默认关闭
            auditStatus:2,                                              //  教育经历默认审核通过
            auditFailReason:'',                                     //  审核原因
            currExamineEdu:{
                 eduId:null,                                              //  当前需要审核的教育经历的id
                 index:null,                                              //  当前需要审核的教育经历的数组索引
            },

            // 奖惩记录开始
            rewardFrm:{
                rewardsType:1,  //  奖惩类型默认为奖励
                rewardsTime:'',  //  奖惩日期(年月日)
                rewardsMoney:0,  //  奖惩金额默认为0
                rewardsReason:'',  //  奖惩原因
                fileNum : '',               //  文件编号
                editReason:'',  // 修改原因
            },
            rewardList:[],                                                      //  奖惩记录列表
            isRewardFrmShow:false,                                      //  默认隐藏奖惩表单
            isAddorEditRewardBtn:true,                                                   //  默认为确认提交按钮
            currEditorReward:{
                 rewardId:null,                                              //  当前修改的奖惩记录的id
                 index:null,                                              //  当前修改的奖惩记录的数组索引
            },
            rewardDialogVisible:false,                             //  奖惩记录审核弹框默认关闭
            rewardAuditStatus:2,                                              //  奖惩记录默认审核通过
            rewardsReason:'',                                     //  审核原因
            currExamineReward:{
                 rewardId:null,                                              //  当前需要审核的奖惩记录的id
                 index:null,                                              //  当前需要审核的奖惩记录的数组索引
            },

            // 调岗记录开始
            postTransFrm:{
                postAdjustTime:'',  //  调岗时间（精确到年月日）
                oldPostId : null,  //  原来职位id
                newPostId : null,  //  新的职位id
                oldDepartId : null,  //  原来部门id
                newDepartId : null,  //  新的部门id
                oldPostName : '',  //  原来职位
                newPostName : '',  //  新的职位
                oldDepartName : '',  //  原来部门
                newDepartName : '',  //  新的部门
                postAdjustReason : '',  //  调岗原因
                fileNum : '',               //  文件编号
                editReason:'',  // 修改原因
            },
            postTransList:[],                                                      //  调岗记录列表
            isPostTransFrmShow:false,                                      //  默认隐藏调岗表单
            isAddorEditPostTransBtn:true,                                                   //  默认为确认提交按钮
            currEditorPostTrans:{
                 postTransId:null,                                              //  当前修改的调岗记录的id
                 index:null,                                              //  当前修改的调岗记录的数组索引
            },
            postTransDialogVisible:false,                             //  调岗记录审核弹框默认关闭
            postTransAuditStatus:2,                                              //  调岗记录默认审核通过
            postAdjustReason:'',                                     //  审核原因
            currExaminePostTrans:{
                 postTransId:null,                                              //  当前需要审核的调岗记录的id
                 index:null,                                              //  当前需要审核的调岗记录的数组索引
            },

            departs : [],                                                   //  所有部门列表
            posList : [],                                                   //  所有职位列表

            // 人员状态记录开始
            userStatusFrm:{
                workNature:1,  //  工作状态，默认在职
                // workNatureName:'在职',  //  工作状态，默认在职
                skillLevel : 0,  //  技能等级(0~10自然数)
                experienceLevel : 0,  //  经验等级(0~10自然数)
                eventTime : '',  //  工作状态变更时间
                editReason:'',  // 修改原因
            },
            userStatusList:[],                                                      //  人员动态记录列表
            isUserStatusFrmShow:false,                                      //  默认隐藏人员动态表单
            isAddorEditUserStatusBtn:true,                                                   //  默认为确认提交按钮
            currEditorUserStatus:{
                 userStatusId:null,                                              //  当前修改的动态记录的id
                 index:null,                                              //  当前修改的动态记录的数组索引
            },
            userStatusDialogVisible:false,                             //  动态记录审核弹框默认关闭
            userStatusAuditStatus:2,                                              //  动态记录默认审核通过
            userStatusAdjustReason:'',                          //  审核原因
            currExamineUserStatus:{
                 userStatusId:null,                                              //  当前需要审核的动态记录的id
                 index:null,                                              //  当前需要审核的动态记录的数组索引
            },

            /* 在职信息校验 */
            incumInfoRules : {
                staffNum:[{
                    required: true,
                    message: "请输入工号",
                    trigger: "blur"
                },{
                    min: 6,
                    max: 6,
                    message: "工号必须为6位",
                    trigger: "blur"
                },{
                    validator: validateStaffNum,
                    message: "工号首位大写字母加五位数字",
                    trigger: "blur"
                }]
            },

            // 基本信息校验
             rules: {
                userName: [{
                        required: true,
                        message: "请输入姓名",
                        trigger: "blur"
                    },
                    // {
                    //     validator: validateUserName,
                    //     message: "请输入中文",
                    //     trigger: "blur"
                    // }
                ],
                // userBirth: [{
                //         required: true,
                //         message: "请输入出生年月",
                //         trigger: "blur"
                //     }
                // ],
                nativePlace: [{
                        required: true,
                        message: "请输入籍贯",
                        trigger: "blur"
                    }
                ],
                userEmail: [
                    {
                        required: true,
                        message: "请输入邮箱",
                        trigger: "blur"
                    },
                     { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur'] }
                ],
                qq: [
                    {
                        required: true,
                        message: "请输入qq号",
                        trigger: "blur"
                    },{
                        validator: validateUserQQ,
                        message: "请输入正确的qq号",
                        trigger: "blur"
                    }
                ],
                userTitle: [{
                        required: true,
                        message: "请输入职称",
                        trigger: "blur"
                    }
                ],
                userTel: [{
                        required: true,
                        message: "请输入联系电话",
                        trigger: "blur"
                    }
                ],
                userCardNo: [
                    {
                        required: true,
                        message: "请输入身份证号码",
                        trigger: "blur"
                    },
                    {
                        validator: validateCardNum,
                        message: "身份证输入不合法",
                        trigger: "blur"
                    }
                ],
                perAddress: [{
                        required: true,
                        message: "请输入户籍地址",
                        trigger: "blur"
                    }
                ],
                concatAddress: [{
                        required: true,
                        message: "请输入联系地址",
                        trigger: "blur"
                    }
                ],
                existWorkingAge: [
                    // {
                    //     required: true,
                    //     message: "请输入已有工龄",
                    //     trigger: "blur"
                    // }, 
                    {
                        validator: validateWoringAge,
                        message: "请输入非负整数",
                        trigger: "blur"
                    }
                ],
            },

            // 紧急联系人校验
            memberRules:{
                memberCall: [{
                        required: true,
                        message: "请输入称呼",
                        trigger: "blur"
                    }
                ],
                memberTel: [{
                        required: true,
                        message: "请输入联系电话",
                        trigger: "blur"
                    }
                ],
				
				memberName: [{
                        required: true,
                        message: "请输入姓名",
                        trigger: "blur"
                    },
                    // {
                    //     validator: validateUserName,
                    //     message: "请输入中文",
                    //     trigger: "blur"
                    // }
                ]
            },

            // 教育经历校验
            eduFrmRules:{
                gradSchool: [{
                        required: true,
                        message: "请输入毕业院校",
                        trigger: "blur"
                }],
                professName: [{
                        required: true,
                        message: "请输入专业名称",
                        trigger: "blur"
                }],
                editReason: [{
                        required: true,
                        message: "请输入修改原因",
                        trigger: "blur"
                }],
            },

            // 奖惩记录校验
            rewardFrmRules:{
                fileNum:[{
                        required: true,
                        message: "请输入文件编号",
                        trigger: "blur"
                }],
                 rewardsMoney: [{
                        required: true,
                        message: "请输入奖惩金额",
                        trigger: "blur"
                },{
                        validator: validateRewardsMoney,
                        message: "请输入大于等于0的数字",
                        trigger: "blur"
                }],
                rewardsReason: [{
                        required: true,
                        message: "请输入奖惩原因",
                        trigger: "blur"
                }],
                rewardsTime: [{
                        required: true,
                        message: "请选择奖惩日期",
                        trigger: "blur"
                }],
                editReason: [{
                        required: true,
                        message: "请输入修改原因",
                        trigger: "blur"
                }],
            },

            // 调岗记录表单校验
            postTransFrmRules:{
                fileNum: [{
                        required: true,
                        message: "请输入文件编号",
                        trigger: "blur"
                }],
                newPostId: [{
                        required: true,
                        message: "请选择新的职位",
                        trigger: "blur"
                }],
                newDepartId: [{
                        required: true,
                        message: "请选择新的部门",
                        trigger: "blur"
                }],
                postAdjustReason: [{
                        required: true,
                        message: "请输入调岗原因",
                        trigger: "blur"
                }],
                postAdjustTime: [{
                        required: true,
                        message: "请选择调岗日期",
                        trigger: "blur"
                }],
                editReason: [{
                        required: true,
                        message: "请输入修改原因",
                        trigger: "blur"
                }],
            },

            // 状态记录表单校验
            userStatusFrmRules:{
                eventTime: [{
                        required: true,
                        message: "请选择变更时间",
                        trigger: "blur"
                }],
                editReason: [{
                        required: true,
                        message: "请输入修改原因",
                        trigger: "blur"
                }]
            },
        }
    },
    methods: {
    /* 通过身份证号计算出生年月 */
    changeUserBirth(){
        let userCardNo = this.baseMsgFrm.userCardNo
        if(userCardNo === '' || !validateCardNo(userCardNo)){                               //..如果身份证号验证没有通过
            this.baseMsgFrm.userBirth = ''
            return
        }else{
            this.baseMsgFrm.userBirth = userCardNo.substr(6,4) + '-'  + userCardNo.substr(10,2)
        }
    },

    /* 取消裁剪 */
    cancelCubeImg(){
        this.isShowCropper = false
    },
    /* 上传简历文件之前 */
    beforeUploadFile(file){
        const fileSize = file.size / 1024 / 1024                                              //  换选成M
        let formData = new FormData()
         if(file.type !== 'application/pdf' && file.type !== 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' && file.type !== 'application/msword'){
               _g.toastMsg("warning", '只能上传doc、docx、pdf文件!')
               return
          }
        if(fileSize > 1){                                                                             //  如果超过1M
            _g.toastMsg("warning", '文件不能超过1M!')
               return
        }
        this.tmpFileName = file.name

        formData.append('file',file)
        formData.append('oldFileName',this.oldFileName)
        this.resumeFile = formData

        return false
    },
      //阻止upload的自己上传，进行再操作
      beforeupload(file) {
          const that = this
          let reader = null
          
          if(file.type !== 'image/jpeg' && file.type !== 'image/png'){
               _g.toastMsg("warning", '只能上传jpg、jpeg、png图片!')
               return
          }  

         reader = new FileReader()
                reader.readAsDataURL(file)
                reader.onloadend = function () {
                    that.isShowCropper = true                                                       //  显示图片裁剪
                    that.option.img = this.result                                                       //  把图片加载进入图片裁剪框
            }  

        return false
        // const isJPG = file.type === 'image/jpeg';
        // const isLt2M = file.size / 1024 / 1024 < 2;

        // if (!isJPG) {
        //   this.$message.error('上传头像图片只能是 JPG 格式!');
        // }
        // if (!isLt2M) {
        //   this.$message.error('上传头像图片大小不能超过 2MB!');
        // }
        // return isJPG && isLt2M;
      },
      
      /* 裁剪图片 */
      onCubeImg(){
          this.$refs.cropper.getCropData((data) => {
            //console.log("压缩前的图片大小：" + data.length)
            let img = new Image(),that = this
            img.src = data
            img.onload = function() {
                //let _data = _this.compress(img)
                let blob = dataURItoBlob(data)

                let fileSize = blob.size
                if(fileSize / 1024 > 500){                                          //  图片不能超过500k
                    _g.toastMsg("warning", '图片不能超过500k!')
                    return
                }

                let formData = new FormData()
                formData.append("file", blob,'tem.jpg')
                formData.append("oldPhotoName", that.oldPhotoName)
                formData.append("userId", that.userId)
                // formData.append('ext','jpg')                                        //..默认生成jpg文件
                that.paramFile = formData

                //console.log("将blob对象转成formData对象：" + formData.get("icon"))
                // that.$emit('cropped', data, formData)

                that.imageUrl = data                                                            //  渲染图片

                // console.log('data = ',data)
            }
            this.isShowCropper = false                                                  //  关闭裁剪框
            })
      },
      
      /* 上传人员大头照 */
      submitPhoto(){
        const that = this

        that.$confirm('是否确认上传图片?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
              }).then(() => {
                  _g.showLoading('上传中')
                that.apiPostFile('admin/resume/uploadUserPhoto', that.paramFile).then((res) => {
                    _g.showLoading().close()
                    if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)

                            // 重置
                            that.paramFile = null
                            that.imageUrl = res.data.imgUrl                                //  渲染图片
                            that.oldPhotoName = res.data.photoName              //  已经上传的图片名
                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
                })
            }).catch(() => {})
      },

    /* 简历文件选择改变 */
    handleChange(file, fileList){
        let arr = []
        arr.push({name : file.name})
        this.fileList = arr
    },

    /* 下载简历 */
    //   downloadFile(){
    //     let fileUrl = this.fileUrl // 文件地址
    //     location.href = fileUrl
    //   },

      /* 上传当前人员简历 */
      submitFile(){
        const that = this
        that.$confirm('是否确认上传简历?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
            }).then(() => {
                _g.showLoading('上传中')
                that.apiPostFile('admin/resume/uploadResumeFile', that.resumeFile).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)

                            // 重置
                            this.resumeFile = null                                                                  //  确保每次只上传一份文件
                            that.oldFileName = res.data.resumeFileName              //  已经上传的图片名
                            // that.fileUrl = res.data.fileUrl
                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
            })
        }).catch(() => {})
      },

    /* 在职信息开始 */
    /* 取消修改人员工号 */
    cancelChangeStaffNum(){
        this.isShowStaffNumInput = false
        this.incumInfo.staffNum = this.incumInfo.oldStaffNum
    },
    /* 确认修改工号 */
    updateStaffNum(){
        const that = this
        const userId = that.userId
        const staffNum = that.incumInfo.staffNum

          let data = {
              staffNum,
              userId
          }
          that.$refs['incumInfo'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认修改工号?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/users/updateStaffNum',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.isShowStaffNumInput = false
                                    that.incumInfo.oldStaffNum = staffNum

                                    // 本地存储工号
                                    Cookies.set('staffNum',staffNum)
                                    that.$store.dispatch('setUserStaffNum',staffNum)
                                }else if(res.data.isSuccess === 1 || res.data.isSuccess === 3){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                    that.isShowStaffNumInput = false
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
    },
    /* 在职信息结束 */

      /* 提交用户履历基本信息 */
      submitBaseMsg(){
          const that = this
          const userId = that.userId
          let data = {
              ...that.baseMsgFrm,
              userId
          }
          that.$refs['baseMsgFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认提交基本信息?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/addmsg',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)

                                    // 本地存储用户名
                                    Cookies.set('userName',data.userName)
                                    that.$store.dispatch('setUserName',data.userName)

                                    that.isBaseFrmShow = false
                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                    that.isBaseFrmShow = false
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },
      
      /* 取消新增或编辑紧急联系人 */
      cancel(){
          this.isMemberFrmShow = false
          this.memberFrm.memberCall = ''
          this.memberFrm.memberName = ''
          this.memberFrm.memberTel = ''
      },

    /* 显示新增紧急联系人表单 */
    showMemberFrm(){
        const that = this
        that.isMemberFrmShow = true
        that.isAddorEdit = true                             //  确认提交按钮
    },

     /* 新增紧急联系人 */
      addMember(){
          const that = this
          const data = that.memberFrm
          that.$refs['memberFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认新增?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/addMember',that.memberFrm).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.memberList.push({
                                        memberCall : data.memberCall,
                                        memberName : data.memberName,
                                        memberTel : data.memberTel,
                                        memberId : res.data.id
                                    })
                                    that.isMemberFrmShow = false                                //  隐藏表单

                                    // 重置表单
                                    that.memberFrm.memberCall = ''
                                    that.memberFrm.memberName = ''
                                    that.memberFrm.memberTel = ''

                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },

    /* 编辑紧急联系人 */  
      editShowMemberFrm(memberId,index){
        const that = this
        that.isMemberFrmShow = true                           //  显示表单
        that.isAddorEdit = false                                      //  修改按钮
        that.memberFrm.memberCall = that.memberList[index].memberCall
        that.memberFrm.memberName = that.memberList[index].memberName
        that.memberFrm.memberTel = that.memberList[index].memberTel

        // 当前被编辑的紧急联系人
        that.currEditorMember.memberId = memberId
        that.currEditorMember.index = index
      },

     /* 确认修改紧急联系人 */
      editMember(){
          const that = this
         
          const memberId = that.currEditorMember.memberId
          const index = that.currEditorMember.index
          
           let data = {
               memberId,
               memberCall :  that.memberFrm.memberCall,
               memberName : that.memberFrm.memberName,
               memberTel : that.memberFrm.memberTel
          }

          that.$refs['memberFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认修改?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/editMember',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.memberList.splice(index,1,data)
                                    that.isMemberFrmShow = false                                //  隐藏表单

                                    // 重置
                                    that.memberFrm.memberCall = ''
                                    that.memberFrm.memberName = ''
                                    that.memberFrm.memberTel = ''
                                    that.currEditorMember.memberId = null
                                    that.currEditorMember.index = null

                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },

      /* 删除紧急联系人 */  
      deleteMember(memberId,index){
        const that = this
        that.$confirm('是否确认删除?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
        }).then(() => {
                _g.showLoading('删除中')
                that.apiPost('/admin/resume/deleteMember',{memberId}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)
                            that.memberList.splice(index,1)

                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
            })
        }).catch(() => {})
      },

    /* 显示新增教育经历表单 */
    showEduFrm(){
        const that = this
        that.isEduFrmShow = true
        that.isAddorEditEduBtn = true                             //  确认提交按钮
    },

     /* 取消新增或编辑教育经历 */
      cancelEduFrm(){
          this.isEduFrmShow = false
          this.eduFrm.education = 6
          this.eduFrm.gradSchool = ''
          this.eduFrm.professName = ''
          this.eduFrm.editReason = ''
      },

       /* 编辑人员教育经历 */  
      editShowEduFrm(eduId,index){
        const that = this
        that.isEduFrmShow = true                           //  显示表单
        that.isAddorEditEduBtn = false                                      //  修改按钮
        that.eduFrm.education = that.eduList[index].education
        that.eduFrm.gradSchool = that.eduList[index].gradSchool
        that.eduFrm.professName = that.eduList[index].professName
        // 当前被编辑的紧急联系人
        that.currEditorEdu.eduId = eduId
        that.currEditorEdu.index = index
      },

     /* 新增教育经历 */
      addEdu(){
          const that = this
          const data = that.eduFrm
          const userId = that.userId
          data.userId = userId
          that.$refs['eduFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认新增?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/addEduExper',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.eduList.push({
                                        education : data.education,
                                        gradSchool : data.gradSchool,
                                        professName : data.professName,
                                        editReason : '/',
                                        auditStatus : 1,                                                //  待审核
                                        auditFailReason : '/',
                                        eduId : res.data.eduId
                                    })
                                    that.sortAscByEducation()                               //  根据学历排序

                                    that.isEduFrmShow = false                                //  隐藏表单

                                    // 重置表单
                                    that.eduFrm.education = 6
                                    that.eduFrm.gradSchool = ''
                                    that.eduFrm.professName = ''
                                    that.eduFrm.editReason = ''

                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },

      /* 删除人员教育经历 */  
      deleteEdu(eduId,index){
        const that = this
        that.$confirm('是否确认删除?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
        }).then(() => {
                _g.showLoading('删除中')
                that.apiPost('/admin/resume/deleteEduExper',{eduId}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)
                            that.eduList.splice(index,1)

                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
            })
        }).catch(() => {})
      },

      /* 确认编辑人员教育经历 */
      editEdu(){
          const that = this
          const eduId = that.currEditorEdu.eduId
           const index = that.currEditorEdu.index
          let data = {
              ...that.eduFrm,
              eduId
          }
          that.$refs['eduFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认修改人员教育经历?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/editEduExper',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    data.auditStatus = 1
                                    data.auditFailReason = '/'
                                     that.eduList.splice(index,1,data)

                                    that.sortAscByEducation()                               //  根据学历排序

                                    that.isEduFrmShow = false                                //  隐藏表单

                                    // 重置
                                    that.eduFrm.education = ''
                                    that.eduFrm.gradSchool = ''
                                    that.eduFrm.professName = ''
                                    that.eduFrm.editReason = ''

                                    that.currEditorEdu.eduId = null
                                    that.currEditorEdu.index = null
                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                    that.isEduFrmShow = false
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },
    
    /* 审核人员教育经历 */
    examineEdu(eduId,index){
        this.eduDialogVisible = true                                                //  显示教育经历审核

        this.currExamineEdu.eduId = eduId
        this.currExamineEdu.index = index

    },

    /* 取消审核人员教育经历 */
    cancelExamineEdu(){
        this.eduDialogVisible = false                                                //  隐藏教育经历审核
        this.auditStatus = 2                                                                //  重置审核
        this.auditFailReason = ''
        // 重置
         this.currExamineEdu.eduId = null
        this.currExamineEdu.index = null
    },

    /* 确认审核人员教育经历 */
    sureExamineEdu(){
        const that = this
        const auditStatus = that.auditStatus
        const auditFailReason = that.auditFailReason
        const eduId = that.currExamineEdu.eduId
        const index = that.currExamineEdu.index

        if(auditStatus === 3 && auditFailReason === ''){
            return
        }

        _g.showLoading('提交中')
        let data = {
            eduId,
            auditStatus,
            auditFailReason
        }

        that.apiPost('/admin/resume/examineEduExper',data).then((res) => {
            _g.showLoading().close()
            if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){
                        _g.toastMsg("success", res.message)
                        that.eduList[index].auditStatus = auditStatus
                        that.eduList[index].auditFailReason = auditFailReason || '/'

                        // 重置
                        that.cancelExamineEdu()
                    }else if(res.data.isSuccess === 1){
                        _g.toastMsg("error", res.message)
                    }
                }
        })
    },

    // /* 根据教育经历学历降排序 */
    //   sortDescByEducation(){
    //        let sortEduList = this.eduList
    //       sortEduList.sort(function(obj1,obj2){
    //         let val1 = obj1.education
    //         let val2 = obj2.education
    //         if (val1 < val2) {
    //             return 1;
    //         } else if (val1 > val2) {
    //             return -1;
    //         } else {
    //             return 0;
    //         }         
    //       });
    //       this.eduList = sortEduList
    //   },

      /* 根据教育经历学历升排序 */
      sortAscByEducation(){
        let sortEduList = this.eduList
        sortEduList.sort(function(obj1,obj2){
        let val1 = obj1.education
        let val2 = obj2.education
        if (val1 < val2) {
            return -1;
        } else if (val1 > val2) {
            return 1;
        } else {
            return 0;
        }   
        });
        this.eduList = sortEduList
      },

    // /* 根据教育经历审核状态降排序 */
    //   sortDescByAuditStatus(){
    //        let sortEduList = this.eduList
    //       sortEduList.sort(function(obj1,obj2){
    //         let val1 = obj1.auditStatus
    //         let val2 = obj2.auditStatus
    //         if (val1 < val2) {
    //             return 1;
    //         } else if (val1 > val2) {
    //             return -1;
    //         } else {
    //             return 0;
    //         }         
    //       });
    //       this.eduList = sortEduList
    //   },

    //   /* 根据教育经历审核状态升排序 */
    //   sortAscByAuditStatus(){
    //     let sortEduList = this.eduList
    //     sortEduList.sort(function(obj1,obj2){
    //     let val1 = obj1.auditStatus
    //     let val2 = obj2.auditStatus
    //     if (val1 < val2) {
    //         return -1;
    //     } else if (val1 > val2) {
    //         return 1;
    //     } else {
    //         return 0;
    //     }   
    //     });
    //     this.eduList = sortEduList
    //   },

     /* 确认修改紧急联系人 */
      editMember(){
          const that = this
         
          const memberId = that.currEditorMember.memberId
          const index = that.currEditorMember
          
           let data = {
               memberId,
               memberCall :  that.memberFrm.memberCall,
               memberName : that.memberFrm.memberName,
               memberTel : that.memberFrm.memberTel
          }

          that.$refs['memberFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认修改?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/editMember',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.memberList.splice(index,1,data)
                                    that.isMemberFrmShow = false                                //  隐藏表单

                                    // 重置
                                    that.memberFrm.memberCall = ''
                                    that.memberFrm.memberName = ''
                                    that.memberFrm.memberTel = ''
                                    that.currEditorMember.memberId = null
                                    that.currEditorMember.index = null

                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                    that.isMemberFrmShow = false                                //  隐藏表单
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },

      /* 删除紧急联系人 */  
      deleteMember(memberId,index){
        const that = this
        that.$confirm('是否确认删除?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
        }).then(() => {
                _g.showLoading('删除中')
                that.apiPost('/admin/resume/deleteMember',{memberId}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)
                            that.memberList.splice(index,1)

                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
            })
        }).catch(() => {})
      },
      
      /* 显示新增奖惩记录表单 */
    showRewardFrm(){
        this.isRewardFrmShow = true
        this.isAddorEditRewardBtn = true                             //  确认提交按钮
    },

     /* 取消新增或编辑奖惩记录 */
      cancelRewardFrm(){
          this.isRewardFrmShow = false
          this.rewardFrm.rewardsType = 1                        //  奖惩类型默认为奖励
          this.rewardFrm.rewardsTime = ''                       //  奖惩日期(年月日)
          this.rewardFrm.rewardsMoney = 0                     //  奖惩金额默认为0
          this.rewardFrm.rewardsReason = ''                     //  奖惩原因
          this.rewardFrm.fileNum = ''                     //  文件编号
          this.rewardFrm.editReason = ''                     //  文件编号
      },

       /* 编辑人员奖惩记录 */  
      editShowRewardFrm(rewardId,index){
        const that = this
        that.isRewardFrmShow = true                           //  显示表单
        that.isAddorEditRewardBtn = false                                      //  修改按钮
        that.rewardFrm.rewardsType = that.rewardList[index].rewardsType
        that.rewardFrm.rewardsTime = that.rewardList[index].rewardsTime
        that.rewardFrm.rewardsMoney = that.rewardList[index].rewardsMoney
        that.rewardFrm.rewardsReason = that.rewardList[index].rewardsReason
        that.rewardFrm.fileNum = that.rewardList[index].fileNum
        //  当前需要编辑的奖惩记录
        that.currEditorReward.rewardId = rewardId
        that.currEditorReward.index = index
      },

     /* 新增人员奖惩记录 */
      addReward(){
          const that = this
          const data = that.rewardFrm
          const userId = that.userId
          data.userId = userId
          that.$refs['rewardFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认新增?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/addReward',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.rewardList.push({
                                        rewardsType : data.rewardsType,
                                        rewardsTime : data.rewardsTime,
                                        rewardsMoney : data.rewardsMoney,
                                        rewardsReason : data.rewardsReason,
                                        editReason : '/',
                                        fileNum : data.fileNum,
                                        auditStatus : 1,                                                //  待审核
                                        auditFailReason : '/',
                                        rewardId : res.data.rewardId
                                    })
                                    
                                    that.sortAscByRewardTime()                          //  奖惩日期升排序

                                    that.isRewardFrmShow = false                                //  隐藏表单

                                    // 重置表单
                                    that.rewardFrm.rewardsType = 6
                                    that.rewardFrm.rewardsTime = ''
                                    that.rewardFrm.rewardsMoney = ''
                                    that.rewardFrm.rewardsReason = ''
                                    that.rewardFrm.fileNum = ''
                                    that.rewardFrm.editReason = ''
                                }else if(res.data.isSuccess === 1 || res.data.isSuccess === 2){
                                    _g.toastMsg("error", res.message)
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },

      /* 删除人员奖惩记录 */  
      deleteReward(rewardId,index){
        const that = this
        that.$confirm('是否确认删除?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
        }).then(() => {
                _g.showLoading('删除中')
                that.apiPost('/admin/resume/deleteReward',{rewardId}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)
                            that.rewardList.splice(index,1)

                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
            })
        }).catch(() => {})
      },

      /* 编辑人员奖惩记录 */
      editReward(){
          const that = this
          const rewardId = that.currEditorReward.rewardId
           const index = that.currEditorReward.index
          let data = {
              ...that.rewardFrm,
              rewardId
          }
          that.$refs['rewardFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认修改人员奖惩记录?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/editReward',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    data.auditStatus = 1
                                    data.auditFailReason = '/'
                                     that.rewardList.splice(index,1,data)

                                    that.sortAscByRewardTime()                          //  奖惩日期升排序

                                    that.isRewardFrmShow = false                                //  隐藏表单

                                    // 重置
                                    that.rewardFrm.rewardsType = 1
                                    that.rewardFrm.rewardsTime = ''
                                    that.rewardFrm.rewardsMoney = 0
                                    that.rewardFrm.rewardsReason = ''
                                    that.rewardFrm.fileNum = ''
                                    that.rewardFrm.editReason = ''

                                    that.currEditorReward.rewardId = null
                                    that.currEditorReward.index = null
                                }else if(res.data.isSuccess === 1 || res.data.isSuccess === 3){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                    that.isRewardFrmShow = false
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },
    
    /* 审核人员奖惩记录 */
    examineReward(rewardId,index){
        this.rewardDialogVisible = true                                                //  显示奖惩记录审核弹框

        this.currExamineReward.rewardId = rewardId
        this.currExamineReward.index = index

    },

    /* 取消审核人员奖惩记录 */
    cancelExamineReward(){
        this.rewardDialogVisible = false                                                //  隐藏奖惩记录审核弹框
        this.rewardAuditStatus = 2                                                                //  重置审核
        this.rewardsReason = ''
        // 重置
         this.currExamineReward.rewardId = null
        this.currExamineEdu.index = null
    },

    /* 确认审核人员奖惩记录 */
    sureExamineReward(){
        const that = this
        const rewardAuditStatus = that.rewardAuditStatus
        const rewardAuditReason = that.rewardsReason
        const rewardId = that.currExamineReward.rewardId
        const index = that.currExamineReward.index

        if(rewardAuditStatus === 3 && rewardAuditReason === ''){
            return
        }

        _g.showLoading('提交中')
        let data = {
            rewardId,
            rewardAuditStatus,
            rewardAuditReason
        }

        that.apiPost('/admin/resume/examineReward',data).then((res) => {
            _g.showLoading().close()
            if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){
                        _g.toastMsg("success", res.message)
                        that.rewardList[index].auditStatus = rewardAuditStatus
                        that.rewardList[index].auditFailReason = rewardAuditReason || '/'

                        // 重置
                        that.cancelExamineReward()
                    }else if(res.data.isSuccess === 1){
                        _g.toastMsg("error", res.message)
                    }
                }
        })
    },

    /* 根据奖惩记录奖惩类型降排序 */
    //   sortDescByRewardType(){
    //        let sortRewardList = this.rewardList
    //       sortRewardList.sort(function(obj1,obj2){
    //         let val1 = obj1.rewardsType
    //         let val2 = obj2.rewardsType
    //         if (val1 < val2) {
    //             return 1;
    //         } else if (val1 > val2) {
    //             return -1;
    //         } else {
    //             return 0;
    //         }         
    //       });
    //       this.rewardList = sortRewardList
    //   },

      /* 根据奖惩记录奖惩类型升排序 */
    //   sortAscByRewardType(){
    //     let sortRewardList = this.rewardList
    //     sortRewardList.sort(function(obj1,obj2){
    //     let val1 = obj1.rewardsType
    //     let val2 = obj2.rewardsType
    //     if (val1 < val2) {
    //         return -1;
    //     } else if (val1 > val2) {
    //         return 1;
    //     } else {
    //         return 0;
    //     }   
    //     });
    //     this.rewardList = sortRewardList
    //   },

    /* 根据奖惩记录 - 奖惩日期降排序 */
    //   sortDescByRewardTime(){
    //        let sortRewardList = this.rewardList
    //       sortRewardList.sort(function(obj1,obj2){
    //         let val1 = new Date(obj1.rewardsTime).getTime()
    //         let val2 = new Date(obj2.rewardsTime).getTime()
    //         if (val1 < val2) {
    //             return 1;
    //         } else if (val1 > val2) {
    //             return -1;
    //         } else {
    //             return 0;
    //         }         
    //       });
    //       this.rewardList = sortRewardList
    //   },

      /* 根据奖惩记录 - 奖惩日期升排序 */
      sortAscByRewardTime(){
        let sortRewardList = this.rewardList
        sortRewardList.sort(function(obj1,obj2){
        let val1 = new Date(obj1.rewardsTime).getTime()
        let val2 = new Date(obj2.rewardsTime).getTime()
        if (val1 < val2) {
            return -1;
        } else if (val1 > val2) {
            return 1;
        } else {
            return 0;
        }   
        });
        this.rewardList = sortRewardList
      },

    /* 根据奖惩记录 - 审核状态降排序 */
    //   sortDescByRewardAuditStatus(){
    //        let sortRewardList = this.rewardList
    //       sortRewardList.sort(function(obj1,obj2){
    //         let val1 = obj1.auditStatus
    //         let val2 = obj2.auditStatus
    //         if (val1 < val2) {
    //             return 1;
    //         } else if (val1 > val2) {
    //             return -1;
    //         } else {
    //             return 0;
    //         }         
    //       });
    //       this.rewardList = sortRewardList
    //   },

      /* 根据奖惩记录 - 审核状态升排序 */
    //   sortAscByRewardAuditStatus(){
    //     let sortRewardList = this.rewardList
    //     sortRewardList.sort(function(obj1,obj2){
    //     let val1 = obj1.auditStatus
    //     let val2 = obj2.auditStatus
    //     if (val1 < val2) {
    //         return -1;
    //     } else if (val1 > val2) {
    //         return 1;
    //     } else {
    //         return 0;
    //     }   
    //     });
    //     this.rewardList = sortRewardList
    //   },
      
        /* 根据调岗记录 调岗时间升排序 */
      sortAscByPostAdjustTime(){
        let sortPostTransList = this.postTransList
        sortPostTransList.sort(function(obj1,obj2){
        let val1 = new Date(obj1.postAdjustTime).getTime()
        let val2 = new Date(obj2.postAdjustTime).getTime()
        if (val1 < val2) {
            return -1;
        } else if (val1 > val2) {
            return 1;
        } else {
            return 0;
        }   
        });
        this.postTransList = sortPostTransList
      },

      /* 下拉框选择新职位改变事件 */
      selNewPos(){
          const posList = this.posList
          const currPosId = this.postTransFrm.newPostId
          let currPosName = ''
        //   根据职位id，查找职位名字
          for(let item of posList){
              if(item.id === currPosId){
                  currPosName = item.pos_name
                  break
              }
          }
          this.postTransFrm.newPostName = currPosName
      },

      /* 下拉框选择新部门改变事件 */
      selNewDepart(){
          const departs = this.departs
          const currDepartId = this.postTransFrm.newDepartId
          let currDepartName = ''
        //   根据部门id，查找部门名字
          for(let item of departs){
              if(item.id === currDepartId){
                  currDepartName = item.depart_name
                  break
              }
          }
          this.postTransFrm.newDepartName = currDepartName
      },

    /* 显示新增调岗记录表单 */
    showPostTransFrm(){
        const len = this.postTransList.length
        this.isPostTransFrmShow = true
        this.isAddorEditPostTransBtn = true                             //  确认提交按钮

        if(len > 0){                                                                    //  如果有调岗记录
            this.postTransFrm.oldPostId = this.postTransList[len - 1].newPostId                       //    原来职位id
            this.postTransFrm.oldDepartId = this.postTransList[len - 1].newDepartId                     //   原来部门id
            this.postTransFrm.oldPostName = this.postTransList[len - 1].newPostName                       //   原来职位
            this.postTransFrm.oldDepartName = this.postTransList[len - 1].oldDepartName                     //   原来部门
        }else{                                                                          //  如果没有调岗记录
            this.postTransFrm.oldPostId = this.incumInfo.posId                       //    原来职位id
            this.postTransFrm.oldDepartId = this.incumInfo.departId                     //   原来部门id
            this.postTransFrm.oldPostName = this.incumInfo.posName                       //   原来职位
            this.postTransFrm.oldDepartName = this.incumInfo.depart                     //   原来部门
        }
       
    },

     /* 取消新增或编辑调岗记录 */
      cancelPostTransFrm(){
          this.isPostTransFrmShow = false
          this.postTransFrm.postAdjustTime = ''                        //   调岗时间（精确到年月日）
          this.postTransFrm.oldPostId = null                       //    原来职位id
          this.postTransFrm.newPostId = null                     //   新的职位id
          this.postTransFrm.oldDepartId = null                     //   原来部门id
          this.postTransFrm.newDepartId = null                        //   新的部门id
          this.postTransFrm.oldPostName = ''                       //   原来职位
          this.postTransFrm.newPostName = ''                     //   新的职位
          this.postTransFrm.oldDepartName = ''                     //   原来部门
          this.postTransFrm.newDepartName = ''                     //   新的部门
          this.postTransFrm.postAdjustReason = ''                     //   调岗原因
          this.postTransFrm.fileNum = ''                     //   文件编号
          this.postTransFrm.editReason = ''                     //   修改原因
      },

       /* 编辑人员调岗记录 */  
      editShowPostTransFrm(postTransId,index){
        const that = this
        that.isPostTransFrmShow = true                           //  显示表单
        that.isAddorEditPostTransBtn = false                                      //  修改按钮
        that.postTransFrm.postAdjustTime = that.postTransList[index].postAdjustTime
        that.postTransFrm.oldPostId = that.postTransList[index].oldPostId
        that.postTransFrm.newPostId = that.postTransList[index].newPostId
        that.postTransFrm.oldDepartId = that.postTransList[index].oldDepartId
        that.postTransFrm.newDepartId = that.postTransList[index].newDepartId
        that.postTransFrm.oldPostName = that.postTransList[index].oldPostName
        that.postTransFrm.newPostName = that.postTransList[index].newPostName
        that.postTransFrm.oldDepartName = that.postTransList[index].oldDepartName
        that.postTransFrm.newDepartName = that.postTransList[index].newDepartName
        that.postTransFrm.postAdjustReason = that.postTransList[index].postAdjustReason
        that.postTransFrm.fileNum = that.postTransList[index].fileNum
        //  当前需要编辑的调岗记录
        that.currEditorPostTrans.postTransId = postTransId
        that.currEditorPostTrans.index = index
      },

     /* 新增人员调岗记录 */
      addPostTrans(){
          const that = this
          const data = that.postTransFrm
          const userId = that.userId
          data.userId = userId
          
          if(data.oldPostId === data.newPostId && data.oldDepartId === data.newDepartId){
              _g.toastMsg('warning', '新老部门或新老职位必须有一个不同')
              return
          }

          that.$refs['postTransFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认新增?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/addPostTrans',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.postTransList.push({
                                        postAdjustTime : data.postAdjustTime,
                                        oldPostId : data.oldPostId,
                                        newPostId : data.newPostId,
                                        oldDepartId : data.oldDepartId,
                                        newDepartId : data.newDepartId,
                                        oldPostName : data.oldPostName,
                                        newPostName : data.newPostName,
                                        oldDepartName : data.oldDepartName,
                                        newDepartName : data.newDepartName,
                                        postAdjustReason : data.postAdjustReason,
                                        fileNum : data.fileNum,
                                        editReason :  '/',
                                        auditStatus : 1,                                                //  待审核
                                        auditFailReason : '/',
                                        postTransId : res.data.postTransId
                                    })
                                    
                                    that.sortAscByPostAdjustTime()                  //  根据调岗日期排序

                                    that.isPostTransFrmShow = false                                //  隐藏表单

                                    // 重置表单
                                    that.cancelPostTransFrm()

                                    // 同步更新在职信息的职位与部门
                                    that.incumInfo.depart = data.newDepartName
                                    that.incumInfo.posName = data.newPostName
                                    that.incumInfo.departId = data.newDepartId
                                    that.incumInfo.posId = data.newPostId
                                }else if(res.data.isSuccess === 1 || res.data.isSuccess === 2){
                                    _g.toastMsg("error", res.message)
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },

      /* 删除人员调岗记录 */  
      deletePostTrans(postTransId,index){
        const that = this
        that.$confirm('是否确认删除?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
        }).then(() => {
                _g.showLoading('删除中')
                that.apiPost('/admin/resume/deletePostTrans',{postTransId}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)
                            that.postTransList.splice(index,1)

                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
            })
        }).catch(() => {})
      },

      /* 确认编辑人员调岗记录 */
      editPostTrans(){
          const that = this
          const postTransId = that.currEditorPostTrans.postTransId
           const index = that.currEditorPostTrans.index
           const userId = that.userId
          let data = {
              ...that.postTransFrm,
              postTransId,
              userId
          }

          that.$refs['postTransFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认修改人员调岗记录?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/editPostTrans',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    data.auditStatus = 1
                                    data.auditFailReason = '/'
                                     that.postTransList.splice(index,1,data)

                                    that.sortAscByPostAdjustTime()                                      //  根据调岗日期排序

                                    that.isPostTransFrmShow = false                                //  隐藏表单

                                    // 重置
                                    that.cancelPostTransFrm()
                                    that.currEditorPostTrans.postTransId = null
                                    that.currEditorPostTrans.index = null

                                    // 同步更新在职信息的职位与部门
                                    that.incumInfo.depart = data.newDepartName
                                    that.incumInfo.posName = data.newPostName
                                    that.incumInfo.departId = data.newDepartId
                                    that.incumInfo.posId = data.newPostId
                                }else if(res.data.isSuccess === 1 || res.data.isSuccess === 3){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                    that.isPostTransFrmShow = false
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },
    
    /* 审核人员调岗记录 */
    examinePostTrans(postTransId,index){
        this.postTransDialogVisible = true                                                //  显示调岗记录审核弹框

        this.currExaminePostTrans.postTransId = postTransId
        this.currExaminePostTrans.index = index

    },

    /* 取消审核人员调岗记录 */
    cancelExaminePostTrans(){
        this.postTransDialogVisible = false                                                //  隐藏调岗记录审核弹框
        this.postTransAuditStatus = 2                                                                //  重置审核
        this.postAdjustReason = ''
        // 重置
         this.currExaminePostTrans.postTransId = null
        this.currExaminePostTrans.index = null
    },

    /* 确认审核人员调岗记录 */
    sureExaminePostTrans(){
        const that = this
        const postTransAuditStatus = that.postTransAuditStatus
        const postAdjustReason = that.postAdjustReason
        const postTransId = that.currExaminePostTrans.postTransId
        const index = that.currExaminePostTrans.index

        if(postAdjustReason === 3 && postAdjustReason === ''){
            return
        }

        _g.showLoading('提交中')
        let data = {
            postTransId,
            postTransAuditStatus,
            postAdjustReason
        }

        that.apiPost('/admin/resume/examinePostTrans',data).then((res) => {
            _g.showLoading().close()
            if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){
                        _g.toastMsg("success", res.message)
                        that.postTransList[index].auditStatus = postTransAuditStatus
                        that.postTransList[index].auditFailReason = postAdjustReason || '/'

                        // 重置
                        that.cancelExaminePostTrans()
                    }else if(res.data.isSuccess === 1){
                        _g.toastMsg("error", res.message)
                    }
                }
        })
    },
    
    /* 显示新增人员状态记录表单 */
    showUserStatusFrm(){
        this.isUserStatusFrmShow = true
        this.isAddorEditUserStatusBtn = true                             //  确认提交按钮
    },

     /* 取消新增或编辑状态记录 */
      cancelUserStatusFrm(){
          this.isUserStatusFrmShow = false
          this.userStatusFrm.workNature = 1                        //    工作状态，默认在职
          this.userStatusFrm.skillLevel = 0                       //     技能等级(0~10自然数)
          this.userStatusFrm.experienceLevel = 0                     //    经验等级(0~10自然数)
          this.userStatusFrm.eventTime = ''                     //    工作状态变更时间
          this.userStatusFrm.editReason = ''                     //    修改原因
      },

       /* 编辑人员状态记录 */  
      editShowUserStatusFrm(userStatusId,index){
        const that = this
        that.isUserStatusFrmShow = true                           //  显示表单
        that.isAddorEditUserStatusBtn = false                                      //  修改按钮
        that.userStatusFrm.workNature = that.userStatusList[index].workNature
        that.userStatusFrm.skillLevel = that.userStatusList[index].skillLevel
        that.userStatusFrm.experienceLevel = that.userStatusList[index].experienceLevel
        that.userStatusFrm.eventTime = that.userStatusList[index].eventTime
        //  当前需要编辑的状态记录
        that.currEditorUserStatus.userStatusId = userStatusId
        that.currEditorUserStatus.index = index
      },

     /* 新增人员状态记录 */
      addUserStatus (){
          const that = this
          const data = that.userStatusFrm
          const userId = that.userId
          data.userId = userId
          
          that.$refs['userStatusFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认新增?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/addUserStatus',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    that.userStatusList.push({
                                        workNature : data.workNature,
                                        skillLevel : data.skillLevel,
                                        experienceLevel : data.experienceLevel,
                                        eventTime : data.eventTime,
                                        comWorkingTime : res.data.comWorkingTime,
                                        totalWorkingTime : res.data.totalWorkingTime,
                                        editReason : '/',
                                        auditStatus : 1,                                                //  待审核
                                        auditFailReason : '/',
                                        userStatusId : res.data.userStatusId
                                    })
                                    
                                    that.sortAscByEventTime()                  //  根据工作状态变更时间排序

                                    that.isUserStatusFrmShow = false                                //  隐藏表单

                                    // 重置表单
                                    that.cancelUserStatusFrm()

                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },

      /* 删除人员状态记录 */  
      deleteUserStatus(userStatusId,index){
        const that = this
        that.$confirm('是否确认删除?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
            center: true
        }).then(() => {
                _g.showLoading('删除中')
                that.apiPost('/admin/resume/deleteUserStatus',{userStatusId}).then((res) => {
                _g.showLoading().close()
                if(typeof res === 'string'){
                        res = JSON.parse(res)
                    }
                    if (res.code != 200) {
                        that.handleError(res)
                    } else {
                        if(res.data.isSuccess === 0){
                            _g.toastMsg("success", res.message)
                            that.userStatusList.splice(index,1)

                        }else if(res.data.isSuccess === 1){
                            _g.toastMsg("error", res.message)
                        }
                    }
            })
        }).catch(() => {})
      },

      /* 确认编辑人员状态记录 */
      editUserStatus(){
          const that = this
          const userStatusId = that.currEditorUserStatus.userStatusId
           const index = that.currEditorUserStatus.index
           const userId = that.userId
          let data = {
              ...that.userStatusFrm,
              userStatusId,
              userId
          }

          that.$refs['userStatusFrm'].validate(valid => {
              if (valid) {
                that.$confirm('是否确认修改人员状态记录?', '提示', {
                  confirmButtonText: '确定',
                  cancelButtonText: '取消',
                  type: 'warning',
                  center: true
                }).then(() => {
                        _g.showLoading('提交中')
                        that.apiPost('/admin/resume/editUserStatus',data).then((res) => {
                        _g.showLoading().close()
                        if(typeof res === 'string'){
                                res = JSON.parse(res)
                            }
                            if (res.code != 200) {
                                that.handleError(res)
                            } else {
                                if(res.data.isSuccess === 0){
                                    _g.toastMsg("success", res.message)
                                    data.auditStatus = 1
                                    data.auditFailReason = '/'

                                    // 工龄暂时先写死
                                    data.comWorkingTime = 0
                                    data.totalWorkingTime = 0

                                     that.userStatusList.splice(index,1,data)

                                    that.sortAscByEventTime()                                      //  根据工作状态变更日期排序

                                    // 重置
                                    that.cancelUserStatusFrm()
                                    that.currEditorUserStatus.userStatusId = null
                                    that.currEditorUserStatus.index = null
                                }else if(res.data.isSuccess === 1){
                                    _g.toastMsg("error", res.message)
                                }else if(res.data.isSuccess === 2){
                                    _g.toastMsg("warning", res.message)
                                    that.isUserStatusFrmShow = false
                                }
                            }
                    })
                }).catch(() => {})
              }
          })
      },
    
    /* 审核人员状态记录 */
    examineUserStatus(userStatusId,index){
        this.userStatusDialogVisible = true                                                //  显示状态记录审核弹框

        this.currExamineUserStatus.userStatusId = userStatusId
        this.currExamineUserStatus.index = index

    },

    /* 取消审核人员状态记录 */
    cancelExamineUserStatus(){
        this.userStatusDialogVisible = false                                                //  隐藏状态记录审核弹框
        this.userStatusAuditStatus = 2                                                                //  重置审核
        this.userStatusAdjustReason = ''
        // 重置
         this.currExamineUserStatus.userStatusId = null
        this.currExamineUserStatus.index = null
    },

    /* 确认审核人员状态记录 */
    sureExamineUserStatus(){
        const that = this
        const userStatusAuditStatus = that.userStatusAuditStatus
        const userStatusAdjustReason = that.userStatusAdjustReason
        const userStatusId = that.currExamineUserStatus.userStatusId
        const index = that.currExamineUserStatus.index

        if(userStatusAdjustReason === 3 && userStatusAdjustReason === ''){
            return
        }

        _g.showLoading('提交中')
        let data = {
            userStatusId,
            userStatusAuditStatus,
            userStatusAdjustReason
        }

        that.apiPost('/admin/resume/examineUserStatus',data).then((res) => {
            _g.showLoading().close()
            if(typeof res === 'string'){
                    res = JSON.parse(res)
                }
                if (res.code != 200) {
                    that.handleError(res)
                } else {
                    if(res.data.isSuccess === 0){
                        _g.toastMsg("success", res.message)
                        that.userStatusList[index].auditStatus = userStatusAuditStatus
                        that.userStatusList[index].auditFailReason = userStatusAdjustReason || '/'

                        // 重置
                        that.cancelExamineUserStatus()
                    }else if(res.data.isSuccess === 1){
                        _g.toastMsg("error", res.message)
                    }
                }
        })
    },

       /* 根据工作状态变更时间 升排序 */
      sortAscByEventTime(){

        let sortUserStatusList = this.userStatusList
        sortUserStatusList.sort(function(obj1,obj2){
        let val1 = new Date(obj1.eventTime).getTime()
        let val2 = new Date(obj2.eventTime).getTime()
        if (val1 < val2) {
            return -1;
        } else if (val1 > val2) {
            return 1;
        } else {
            return 0;
        }   
        });
        this.userStatusList = sortUserStatusList
      },

      /* 获取用户履历信息 */
      getUserResume(){
        const that = this

        let memberList = []
        let eduList = []
        let rewardList = []
        let postTransList = []
        let userStatusList = []

        _g.showLoading('加载中');
        that.apiPost("admin/resume/queryByUserId",{userId : that.userId}).then(res => {
            _g.showLoading().close()
            if(typeof res === 'string'){
                res = JSON.parse(res)
            }
            if (res.code != 200) {
                this.handleError(res)
            } else {
                if(res.data.isSuccess === 0){             //  成功

                    // 大头照初始化
                    that.imageUrl = res.data.user.userPhoto.photo_path
                    that.oldPhotoName = res.data.user.userPhoto.photo_name

                    //简历初始化
                    // that.fileUrl = res.data.user.resumeFile.resume_file_path
                    that.tmpFileName = res.data.user.resumeFile.resume_file_name
                    that.oldFileName = res.data.user.resumeFile.resume_file_name

                    // 基本信息初始化
                    that.baseMsgFrm.userName = res.data.user.user_name
                    that.baseMsgFrm.userSex = res.data.user.user_sex
                    that.baseMsgFrm.userBirth = res.data.user.date_birth
                    that.baseMsgFrm.politicalOutlook = res.data.user.political_outlook
                    that.baseMsgFrm.maritalStatus = res.data.user.marital_status
                    that.baseMsgFrm.health = res.data.user.health
                    that.baseMsgFrm.nativePlace = res.data.user.native_place
                    that.baseMsgFrm.userEmail = res.data.user.user_email
                    that.baseMsgFrm.qq = res.data.user.user_qq
                    that.baseMsgFrm.nation = res.data.user.nation
                    that.baseMsgFrm.userTitle = res.data.user.user_title
                    that.baseMsgFrm.userTel = res.data.user.user_tel
                    that.baseMsgFrm.userCardNo = res.data.user.user_card_num
                    that.baseMsgFrm.perAddress = res.data.user.per_address
                    that.baseMsgFrm.concatAddress = res.data.user.concat_address
                    that.baseMsgFrm.existWorkingAge = res.data.user.exist_working_age === null ? '' : res.data.user.exist_working_age

                    // 在职信息初始化
                    that.incumInfo.staffNum = res.data.user.staffnum
                    that.incumInfo.oldStaffNum = res.data.user.staffnum
                    that.incumInfo.posName = res.data.user.post.pos_name
                    that.incumInfo.depart = res.data.user.depart.depart_name
                    that.incumInfo.posId = res.data.user.post.pos_id
                    that.incumInfo.departId = res.data.user.depart.depart_id

                    // 紧急联系人初始化
                    for(let member of res.data.user.familyMember){
                        memberList.push({
                            memberId : member.id,
                            memberCall : member.member_call,
                            memberName : member.member_name,
                            memberTel : member.member_tel,
                        })
                    }
                    that.memberList = memberList

                    // 教育经历初始化
                    for(let education of res.data.user.eduExper){
                        eduList.push({
                            eduId : education.id,
                            education : education.education,
                            gradSchool : education.graduated_school,
                            professName : education.professional_name,
                            auditStatus : education.audit_status,
                            auditFailReason : education.audit_fail_reason || '/',
                            editReason : education.edit_reason || '/',
                        })
                    }
                    that.eduList = eduList
                     that.sortAscByEducation()                                                   //  根据学历排序

                    // 奖惩记录初始化
                    for(let item of res.data.user.rewards){
                        rewardList.push({
                            rewardId : item.id,
                            rewardsType : item.rewards_type,
                            rewardsTime : item.rewards_time,
                            rewardsReason : item.rewards_reason,
                            rewardsMoney : item.rewards_money,
                            auditStatus : item.audit_status,
                            auditFailReason : item.audit_fail_reason || '/',
                            fileNum : item.file_num,
                            editReason : item.edit_reason || '/',
                        })
                    }
                    that.rewardList = rewardList
                    that.sortAscByRewardTime()                              //  根据奖惩日期排序

                    // 岗位调动记录初始化
                    for(let item of res.data.user.postTransferList){
                        postTransList.push({
                            postTransId : item.id,
                            postAdjustTime : item.post_adjust_time,
                            oldPostId : item.old_post_id,
                            newPostId : item.new_post_id,
                            oldDepartId : item.old_depart_id,
                            newDepartId : item.new_depart_id,
                            oldPostName : item.postOld.pos_name,
                            newPostName : item.postNew.pos_name,
                            oldDepartName : item.departOld.depart_name,
                            newDepartName : item.departNew.depart_name,
                            postAdjustReason : item.post_adjust_reason,
                            auditStatus : item.audit_status,
                            auditFailReason : item.audit_fail_reason || '/',
                            fileNum : item.file_num,
                            editReason : item.edit_reason || '/',
                        })
                    }
                    that.postTransList = postTransList
                    that.sortAscByPostAdjustTime()                  //  根据调岗日期排序

                    // 人员状态记录初始化
                    for(let item of res.data.user.userStatusList){
                        userStatusList.push({
                            userStatusId : item.id,
                            workNature : item.work_nature,
                            skillLevel : item.skill_level,
                            experienceLevel : item.experience_level,
                            comWorkingTime : item.company_working_time,
                            totalWorkingTime : item.totalWorkingTime,
                            auditStatus : item.audit_status,
                            auditFailReason : item.audit_fail_reason || '/',
                            eventTime : item.event_time,
                            editReason : item.edit_reason || '/',
                        })
                    }
                    that.userStatusList = userStatusList
                    that.sortAscByEventTime()                  //  根据变更日期排序

                }else{
                    _g.toastMsg("error", res.message)
                }
            }
        })
      },  

      /* 获取所有职位 */
      getPosts() {
        _g.showLoading('职位加载中');
        const that = this
        that.apiPost('admin/post/getAllPosts').then((res) => {
            _g.showLoading().close()
            if(typeof res === 'string'){
                res = JSON.parse(res)
            }
            if (res.code != 200) {
                that.handleError(res)
            } else {
                if(res.data.isSuccess === 0){
                    that.posList = res.data.posList
                }else if(res.data.isSuccess === 1){
                    _g.toastMsg("error", res.message)
                }else if(res.data.isSuccess === 2){                                     //  未设置职位
                    _g.toastMsg("error", res.message)
                    that.$router.push('/admin/position/add')
                }
            }
        })
      },

      /* 获取所有部门 */
      getDeparts() {
        _g.showLoading('部门加载中');
        const that = this
        that.apiPost('admin/addDepart').then((res) => {
            _g.showLoading().close()
            if(typeof res === 'string'){
                res = JSON.parse(res)
            }
            if (res.code != 200) {
                that.handleError(res)
            } else {
                if(res.data.isSuccess === 0){
                    that.departs = res.data.departList
                }else if(res.data.isSuccess === 1){
                    _g.toastMsg("error", res.message)
                }else if(res.data.isSuccess === 2){                                         //  未设置部门
                    _g.toastMsg("error", res.message)
                    that.$router.push('/admin/structures/addDepart')
                }
            }
        })
      },

    },
    created() {
        this.userId = this.$route.query.userId  //  用户id
        this.getUserResume()
        this.getPosts()
        this.getDeparts()
    },
    components: {
    },
    mixins: [http]
  }
</script>

<style scoped>

.avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;

    border: 1px dashed #8c939d;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
    border: 1px dashed #8c939d;
  }

  /* 填写履历信息 */
h3{
    font-size: 14px;
    color: #ef8200;
    padding-bottom: 10px;
}

.line{
    height: 2px;
    background-color: #ef8200;
}

.addResumeWrapper{
    /* width: 1000px; */
    margin: 20px auto;
    /* border: 1px solid #d1d1d1; */
    padding: 0 20px 20px 20px;
} 

.btnGroup{
    position: absolute;
    bottom: 20px;
}

</style>

<style>
/* 重写element下拉列表 */
</style>




